summaryrefslogtreecommitdiff
path: root/include/sfx2/templatedlg.hxx
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-05-01 13:05:00 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-05-20 13:54:17 +0000
commitca040d16d06fead95ad7ed8d10f5995fbade1219 (patch)
tree23ab08bcb53eebc9a2757e5bcffbca8c9c3f38c6 /include/sfx2/templatedlg.hxx
parent365c4d8c60e89fd57a91f51ca51a8796fe91edd7 (diff)
New Template Manager
1. Save Mode removed from Template Manager 2. Context Menu for TemplateViewItems (Handled from LocalView for Local Repos) 3. 'showAllTemplates()' replacing 'showRootRegion()' 4. Filter Combobox for templates (Remembers filters also) 5. Search Filter (Synchronized with Filter ComboBoxes) 6. Removed Tabs from Template Manager 7. Removed Buttons from TemplateAbstractView 8. Unused GtkToolButtons removed 9. PushButtons in UI 10. Modal dialog for Import and Move (Works from "All Categories" now too) 11. ContextMenu for TemplateSearchView 12. Delete Categories(Folder) in Settings Menu 13. Save As Template Dialog Change-Id: I88f6568c35271c17dbd7e6877d50119a8cfe4d60 Reviewed-on: https://gerrit.libreoffice.org/24545 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'include/sfx2/templatedlg.hxx')
-rw-r--r--include/sfx2/templatedlg.hxx92
1 files changed, 67 insertions, 25 deletions
diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index 74d7e0953976..12793ff9319c 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -17,8 +17,6 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
-#include <vcl/tabctrl.hxx>
-#include <vcl/tabpage.hxx>
#include <com/sun/star/frame/XDesktop2.hpp>
#include <sfx2/templateabstractview.hxx>
@@ -52,55 +50,55 @@ public:
virtual ~SfxTemplateManagerDlg();
virtual void dispose() override;
- void setSaveMode();
-
void setDocumentModel (const css::uno::Reference<css::frame::XModel> &rModel);
- DECL_LINK_TYPED(ActivatePageHdl, TabControl*, void);
-
private:
void readSettings ();
void writeSettings ();
- DECL_LINK_TYPED(TBXViewHdl, ToolBox*, void);
- DECL_LINK_TYPED(TBXActionHdl, ToolBox*, void);
- DECL_LINK_TYPED(TBXTemplateHdl, ToolBox*, void);
+ void fillFolderComboBox();
+
DECL_LINK_TYPED(TBXDropdownHdl, ToolBox*, void);
+ DECL_LINK_TYPED(SelectApplicationHdl, ListBox&, void);
+ DECL_LINK_TYPED(SelectRegionHdl, ListBox&, void);
+
DECL_LINK_TYPED(OkClickHdl, Button*, void);
+ DECL_LINK_TYPED(MoveClickHdl, Button*, void);
+ DECL_LINK_TYPED(ExportClickHdl, Button*, void);
+ DECL_LINK_TYPED(ImportClickHdl, Button*, void);
+ DECL_LINK_TYPED(LinkClickHdl, Button*, void);
DECL_LINK_TYPED(TVItemStateHdl, const ThumbnailViewItem*, void);
DECL_LINK_TYPED(MenuSelectHdl, Menu*, bool);
- DECL_LINK_TYPED(MoveMenuSelectHdl, Menu*, bool);
DECL_LINK_TYPED(RepositoryMenuSelectHdl, Menu*, bool);
DECL_LINK_TYPED(DefaultTemplateMenuSelectHdl, Menu*, bool);
DECL_LINK_TYPED(OpenRegionHdl, void*, void);
+ DECL_LINK_TYPED(RightClickHdl, ThumbnailViewItem*, void);
DECL_LINK_TYPED(OpenTemplateHdl, ThumbnailViewItem*, void);
+ DECL_LINK_TYPED(EditTemplateHdl, ThumbnailViewItem*, void);
+ DECL_LINK_TYPED(DeleteTemplateHdl, ThumbnailViewItem*, void);
+ DECL_LINK_TYPED(DefaultTemplateHdl, ThumbnailViewItem*, void);
DECL_LINK_TYPED(SearchUpdateHdl, Edit&, void);
- void OnTemplateImport ();
- void OnTemplateSearch ();
+ void OnTemplateImportCategory(OUString sCategory);
static void OnTemplateLink ();
void OnTemplateOpen ();
- void OnTemplateEdit ();
- void OnTemplateDelete ();
- void OnTemplateAsDefault ();
void OnTemplateExport ();
void OnTemplateState (const ThumbnailViewItem *pItem);
- void OnFolderNew ();
- void OnFolderDelete ();
+ void OnCategoryNew ();
+ void OnCategoryDelete();
void OnRegionState (const ThumbnailViewItem *pItem);
void OnRepositoryDelete ();
- void OnTemplateSaveAs ();
void createRepositoryMenu ();
@@ -138,18 +136,22 @@ private:
void syncRepositories () const;
- /// Return filter according to the currently selected tab page.
- FILTER_APPLICATION getCurrentFilter();
+ /// Return filter according to the currently selected application filter.
+ FILTER_APPLICATION getCurrentApplicationFilter();
private:
- VclPtr<TabControl> mpTabControl;
+ VclPtr<Edit> mpSearchFilter;
+ VclPtr<ListBox> mpCBApp;
+ VclPtr<ListBox> mpCBFolder;
- VclPtr<Edit> mpSearchEdit;
VclPtr<PushButton> mpOKButton;
+ VclPtr<PushButton> mpMoveButton;
+ VclPtr<PushButton> mpExportButton;
+ VclPtr<PushButton> mpImportButton;
+ VclPtr<PushButton> mpLinkButton;
VclPtr<ToolBox> mpViewBar;
VclPtr<ToolBox> mpActionBar;
- VclPtr<ToolBox> mpTemplateBar;
VclPtr<TemplateSearchView> mpSearchView;
VclPtr<TemplateAbstractView> mpCurView;
VclPtr<TemplateLocalView> mpLocalView;
@@ -159,9 +161,7 @@ private:
PopupMenu *mpTemplateDefaultMenu;
std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelTemplates;
- std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelFolders;
- bool mbIsSaveMode; ///< Flag that indicates if we are in save mode or not.
css::uno::Reference< css::frame::XModel > m_xModel;
css::uno::Reference< css::frame::XDesktop2 > mxDesktop;
@@ -169,6 +169,48 @@ private:
std::vector<TemplateRepository*> maRepositories; ///< Stores the remote repositories for templates
};
+// class SfxTemplateCategoryDialog -------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxTemplateCategoryDialog : public ModalDialog
+{
+private:
+ VclPtr<ListBox> mpLBCategory;
+ VclPtr<FixedText> mpSelectLabel;
+ VclPtr<Edit> mpNewCategoryEdit;
+ VclPtr<FixedText> mpCreateLabel;
+ VclPtr<PushButton> mpOKButton;
+
+ OUString msSelectedCategory;
+ bool mbIsNewCategory;
+
+public:
+ DECL_LINK_TYPED(NewCategoryEditHdl, Edit&, void);
+ DECL_LINK_TYPED(SelectCategoryHdl, ListBox&, void);
+
+ void SetCategoryLBEntries(std::vector<OUString> names);
+
+ void HideNewCategoryOption();
+
+ inline OUString GetSelectedCategory() const {
+ return msSelectedCategory;
+ };
+
+ inline void SetSelectLabelText(OUString sText) const {
+ mpSelectLabel->SetText(sText);
+ };
+
+ inline bool IsNewCategoryCreated() const {
+ return mbIsNewCategory;
+ }
+
+public:
+
+ explicit SfxTemplateCategoryDialog(vcl::Window *parent = nullptr);
+
+ virtual ~SfxTemplateCategoryDialog();
+ virtual void dispose() override;
+};
+
#endif // INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */