summaryrefslogtreecommitdiff
path: root/include/sfx2/templatelocalview.hxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-04-18 18:26:28 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-04-23 22:20:31 +0200
commitb9337e22ce1dbf2eba0e8c8db294ae99f4111f91 (patch)
tree53ee1bd3dfd213815a21579151983cb997922b05 /include/sfx2/templatelocalview.hxx
parentf4e1642a1761d5eab6ccdd89928869c2b2f1528a (diff)
execute move of global headers
see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a
Diffstat (limited to 'include/sfx2/templatelocalview.hxx')
-rw-r--r--include/sfx2/templatelocalview.hxx104
1 files changed, 104 insertions, 0 deletions
diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx
new file mode 100644
index 000000000000..6cefaf1782c0
--- /dev/null
+++ b/include/sfx2/templatelocalview.hxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2012 LibreOffice contributors.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef TEMPLATEFOLDERVIEW_HXX
+#define TEMPLATEFOLDERVIEW_HXX
+
+#include <set>
+
+#include <sfx2/templateabstractview.hxx>
+
+class SfxDocumentTemplates;
+class TemplateContainerItem;
+
+namespace com {
+ namespace sun { namespace star { namespace frame {
+ class XModel;
+ } } }
+}
+
+class SFX2_DLLPUBLIC TemplateLocalView : public TemplateAbstractView
+{
+ typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const ThumbnailViewItem*);
+
+public:
+
+ TemplateLocalView ( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+
+ virtual ~TemplateLocalView ();
+
+ // Fill view with template folders thumbnails
+ virtual void Populate ();
+
+ virtual void reload ();
+
+ virtual void showRootRegion ();
+
+ virtual void showRegion (ThumbnailViewItem *pItem);
+
+ void showRegion (const OUString &rName);
+
+ sal_uInt16 getCurRegionItemId () const;
+
+ sal_uInt16 getRegionId (size_t pos) const;
+
+ OUString getRegionName(const sal_uInt16 nRegionId) const;
+
+ OUString getRegionItemName(const sal_uInt16 nItemId) const;
+
+ std::vector<OUString> getFolderNames ();
+
+ std::vector<TemplateItemProperties>
+ getFilteredItems (const boost::function<bool (const TemplateItemProperties&) > &rFunc) const;
+
+ virtual sal_uInt16 createRegion (const OUString &rName);
+
+ virtual bool isNestedRegionAllowed () const;
+
+ virtual bool isImportAllowed () const;
+
+ bool removeRegion (const sal_uInt16 nItemId);
+
+ bool removeTemplate (const sal_uInt16 nItemId, const sal_uInt16 nSrcItemId);
+
+ bool moveTemplate (const ThumbnailViewItem* pItem, const sal_uInt16 nSrcItem,
+ const sal_uInt16 nTargetItem);
+
+ bool moveTemplates (const std::set<const ThumbnailViewItem*,selection_cmp_fn> &rItems, const sal_uInt16 nTargetItem);
+
+ bool copyFrom (const sal_uInt16 nRegionItemId, const BitmapEx &rThumbnail, const OUString &rPath);
+
+ // Import a template to the current region
+ bool copyFrom (const OUString &rPath);
+
+ bool copyFrom(TemplateContainerItem *pItem, const OUString &rPath);
+
+ bool exportTo (const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, const OUString &rName);
+
+ bool saveTemplateAs (sal_uInt16 nItemId,
+ com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel,
+ const OUString &rName);
+
+ bool saveTemplateAs (TemplateContainerItem *pDstItem,
+ com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel,
+ const OUString &rName);
+
+ bool isTemplateNameUnique (const sal_uInt16 nRegionItemId, const OUString &rName) const;
+
+ virtual bool renameItem(ThumbnailViewItem* pItem, OUString sNewTitle);
+
+private:
+
+ SfxDocumentTemplates *mpDocTemplates;
+ std::vector<TemplateContainerItem* > maRegions;
+};
+
+#endif // TEMPLATEFOLDERVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */