summaryrefslogtreecommitdiff
path: root/sfx2/inc
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-07-29 23:30:47 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-07-29 23:34:34 -0430
commite09046cede7ae47615f404474fe289d89f91dac5 (patch)
tree205771d5ddc117c7a475f2fe0ab7bb6fa551ddfe /sfx2/inc
parentff8c376564b935035140bf296ef86ddbb8222bab (diff)
Filter online view templates depending on their type.
- Moved ViewFilter_Application to TemplateAbstractView header. - Removed unused attribute in ViewFilter_Application. Change-Id: I569f6a0c7135781256e348b01cb45aad6b7dcee6
Diffstat (limited to 'sfx2/inc')
-rw-r--r--sfx2/inc/sfx2/templateabstractview.hxx28
-rw-r--r--sfx2/inc/sfx2/templatelocalview.hxx11
-rw-r--r--sfx2/inc/sfx2/templateonlineview.hxx2
3 files changed, 31 insertions, 10 deletions
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 74dcd8a0ff6b..a4b1daf13ce7 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -13,6 +13,32 @@
#include <sfx2/thumbnailview.hxx>
class TemplateView;
+class SfxDocumentTemplates;
+
+enum FILTER_APPLICATION
+{
+ FILTER_APP_NONE,
+ FILTER_APP_WRITER,
+ FILTER_APP_CALC,
+ FILTER_APP_IMPRESS,
+ FILTER_APP_DRAW
+};
+
+// Display template items depending on the generator application
+class ViewFilter_Application
+{
+public:
+
+ ViewFilter_Application (FILTER_APPLICATION App)
+ : mApp(App)
+ {}
+
+ bool operator () (const ThumbnailViewItem *pItem);
+
+private:
+
+ FILTER_APPLICATION mApp;
+};
class SFX2_DLLPUBLIC TemplateAbstractView : public ThumbnailView
{
@@ -27,6 +53,8 @@ public:
// Fill view with template folders thumbnails
virtual void Populate () = 0;
+ virtual void filterTemplatesByApp (const FILTER_APPLICATION &eApp) = 0;
+
virtual void showOverlay (bool bVisible) = 0;
sal_uInt16 getOverlayRegionId () const;
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index f3161e7d3616..67a56ae5d5a9 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -18,15 +18,6 @@
class SfxDocumentTemplates;
class TemplateLocalViewItem;
-enum FILTER_APPLICATION
-{
- FILTER_APP_NONE,
- FILTER_APP_WRITER,
- FILTER_APP_CALC,
- FILTER_APP_IMPRESS,
- FILTER_APP_DRAW
-};
-
class SFX2_DLLPUBLIC TemplateLocalView : public TemplateAbstractView
{
public:
@@ -42,7 +33,7 @@ public:
virtual void showOverlay (bool bVisible);
- void filterTemplatesByApp (const FILTER_APPLICATION &eApp);
+ virtual void filterTemplatesByApp (const FILTER_APPLICATION &eApp);
std::vector<TemplateItemProperties>
getFilteredItems (const boost::function<bool (const TemplateItemProperties&) > &rFunc) const;
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index e868248e25d8..245da5f2d051 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -25,6 +25,8 @@ public:
// Load repositories from user settings.
virtual void Populate ();
+ virtual void filterTemplatesByApp (const FILTER_APPLICATION &eApp);
+
virtual void showOverlay (bool bVisible);
void setItemDimensions (long ItemWidth, long ThumbnailHeight, long DisplayHeight, int itemPadding);