diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-14 23:01:55 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-15 08:15:25 -0430 |
commit | 0703d559335588e69599a4172cbc3aa3d153a98f (patch) | |
tree | 9fda344e966a677cdddb93b394419135300f6ce8 /sfx2 | |
parent | 5a22ac8fddd6db9849033b3f7171cf53160e9212 (diff) |
Move some methods to TemplateAbstractView.
Change-Id: Ie65d5c9c91a1c55c792bf19a9f2ffdb6bb56bb2a
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/templateabstractview.hxx | 14 | ||||
-rw-r--r-- | sfx2/inc/sfx2/templatefolderview.hxx | 12 | ||||
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 32 | ||||
-rw-r--r-- | sfx2/source/control/templatefolderview.cxx | 32 |
4 files changed, 46 insertions, 44 deletions
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx index 580bcbb19575..21cdd4a75d22 100644 --- a/sfx2/inc/sfx2/templateabstractview.hxx +++ b/sfx2/inc/sfx2/templateabstractview.hxx @@ -24,6 +24,20 @@ public: virtual ~TemplateAbstractView (); + // Check if the overlay is visible or not. + bool isOverlayVisible () const; + + void sortOverlayItems (const boost::function<bool (const ThumbnailViewItem*, + const ThumbnailViewItem*) > &func); + + void setOverlayDblClickHdl (const Link &rLink); + + void setOverlayCloseHdl (const Link &rLink); + +protected: + + virtual void OnSelectionMode (bool bMode); + protected: TemplateView *mpItemView; diff --git a/sfx2/inc/sfx2/templatefolderview.hxx b/sfx2/inc/sfx2/templatefolderview.hxx index e75c49e209ce..8e17dd74f2e7 100644 --- a/sfx2/inc/sfx2/templatefolderview.hxx +++ b/sfx2/inc/sfx2/templatefolderview.hxx @@ -40,23 +40,13 @@ public: std::vector<rtl::OUString> getFolderNames (); - // Check if the overlay is visible or not. - bool isOverlayVisible () const; - void showOverlay (bool bVisible); - void setOverlayDblClickHdl (const Link &rLink); - - void setOverlayCloseHdl (const Link &rLink); - void filterTemplatesByApp (const FILTER_APPLICATION &eApp); std::vector<TemplateItemProperties> getFilteredItems (const boost::function<bool (const TemplateItemProperties&) > &rFunc) const; - void sortOverlayItems (const boost::function<bool (const ThumbnailViewItem*, - const ThumbnailViewItem*) > &func); - void setTemplateStateHdl (const Link &aLink) { maTemplateStateHdl = aLink; } sal_uInt16 createRegion (const rtl::OUString &rName); @@ -73,8 +63,6 @@ private: virtual void Resize (); - virtual void OnSelectionMode (bool bMode); - virtual void OnItemDblClicked (ThumbnailViewItem *pRegionItem); DECL_LINK(TVTemplateStateHdl, const ThumbnailViewItem*); diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index ceed5aebcaa9..b32bdd25a4d6 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -28,4 +28,36 @@ TemplateAbstractView::~TemplateAbstractView () delete mpItemView; } +bool TemplateAbstractView::isOverlayVisible () const +{ + return mpItemView->IsVisible(); +} + +void TemplateAbstractView::sortOverlayItems(const boost::function<bool (const ThumbnailViewItem*, + const ThumbnailViewItem*) > &func) +{ + mpItemView->sortItems(func); +} + +void TemplateAbstractView::setOverlayDblClickHdl(const Link &rLink) +{ + mpItemView->setDblClickHdl(rLink); +} + +void TemplateAbstractView::setOverlayCloseHdl(const Link &rLink) +{ + mpItemView->setCloseHdl(rLink); +} + +void TemplateAbstractView::OnSelectionMode (bool bMode) +{ + if (mpItemView->IsVisible()) + { + mbSelectionMode = bMode; + mpItemView->setSelectionMode(bMode); + } + else + ThumbnailView::OnSelectionMode(bMode); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx index 74b330b465d4..3972a499e58b 100644 --- a/sfx2/source/control/templatefolderview.cxx +++ b/sfx2/source/control/templatefolderview.cxx @@ -358,11 +358,6 @@ std::vector<rtl::OUString> TemplateFolderView::getFolderNames() return ret; } -bool TemplateFolderView::isOverlayVisible () const -{ - return mpItemView->IsVisible(); -} - void TemplateFolderView::showOverlay (bool bVisible) { mbActive = !bVisible; @@ -386,16 +381,6 @@ void TemplateFolderView::showOverlay (bool bVisible) } } -void TemplateFolderView::setOverlayDblClickHdl(const Link &rLink) -{ - mpItemView->setDblClickHdl(rLink); -} - -void TemplateFolderView::setOverlayCloseHdl(const Link &rLink) -{ - mpItemView->setCloseHdl(rLink); -} - void TemplateFolderView::filterTemplatesByApp (const FILTER_APPLICATION &eApp) { meFilterOption = eApp; @@ -430,12 +415,6 @@ TemplateFolderView::getFilteredItems(const boost::function<bool (const TemplateI return aItems; } -void TemplateFolderView::sortOverlayItems(const boost::function<bool (const ThumbnailViewItem*, - const ThumbnailViewItem*) > &func) -{ - mpItemView->sortItems(func); -} - sal_uInt16 TemplateFolderView::createRegion(const rtl::OUString &rName) { sal_uInt16 nRegionId = mpDocTemplates->GetRegionCount(); // Next regionId @@ -647,17 +626,6 @@ void TemplateFolderView::Resize() mpItemView->SetPosPixel(aPos); } -void TemplateFolderView::OnSelectionMode (bool bMode) -{ - if (mpItemView->IsVisible()) - { - mbSelectionMode = bMode; - mpItemView->setSelectionMode(bMode); - } - else - ThumbnailView::OnSelectionMode(bMode); -} - void TemplateFolderView::OnItemDblClicked (ThumbnailViewItem *pRegionItem) { // Fill templates |