[Libreoffice-commits] .: 18 commits - sfx2/inc sfx2/Library_sfx.mk sfx2/Package_inc.mk sfx2/source
Rafael Dominguez
rdominguez at kemper.freedesktop.org
Sun Jul 15 05:46:58 PDT 2012
sfx2/Library_sfx.mk | 3
sfx2/Package_inc.mk | 3
sfx2/inc/sfx2/templateabstractview.hxx | 53 +++++
sfx2/inc/sfx2/templatefolderview.hxx | 22 --
sfx2/inc/sfx2/templateonlineview.hxx | 48 +++++
sfx2/inc/sfx2/templateonlineviewitem.hxx | 34 +++
sfx2/inc/sfx2/templateview.hxx | 16 -
sfx2/inc/templatedlg.hxx | 7
sfx2/source/control/templateabstractview.cxx | 63 +++++++
sfx2/source/control/templatefolderview.cxx | 51 +----
sfx2/source/control/templateonlineview.cxx | 223 +++++++++++++++++++++++++
sfx2/source/control/templateonlineviewitem.cxx | 21 ++
sfx2/source/control/templateview.cxx | 23 +-
sfx2/source/doc/templatedlg.cxx | 49 +++++
sfx2/source/doc/templatedlg.hrc | 2
sfx2/source/doc/templatedlg.src | 12 +
16 files changed, 548 insertions(+), 82 deletions(-)
New commits:
commit cbdfab6e43d1462d7c677bc8dd5f66ced51ce88f
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sun Jul 15 08:13:50 2012 -0430
Keep track of the current view and close it when we click close icon.
Change-Id: I63faf58203ac43b4216a57d8ad5fbfe8d9f0bfff
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 307922d..47e6f9b 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -17,6 +17,7 @@
class Edit;
class PopupMenu;
+class TemplateAbstractView;
class TemplateFolderView;
class TemplateOnlineView;
class TemplateSearchView;
@@ -95,6 +96,7 @@ private:
ToolBox *mpActionBar;
ToolBox *mpTemplateBar;
TemplateSearchView *mpSearchView;
+ TemplateAbstractView *mpCurView;
TemplateFolderView *maView;
TemplateOnlineView *mpOnlineView;
PopupMenu *mpCreateMenu;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 6555d7e..05d333b 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -198,6 +198,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
ITEM_MAX_HEIGHT-THUMBNAIL_MAX_HEIGHT,
ITEM_PADDING);
+ mpOnlineView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl));
+
mpSearchView->SetSizePixel(aThumbSize);
mpSearchView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
@@ -308,7 +310,7 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, CloseOverlayHdl)
mpTemplateBar->Hide();
mpViewBar->Show();
- maView->showOverlay(false);
+ mpCurView->showOverlay(false);
return 0;
}
@@ -839,6 +841,8 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
{
if (bDisplayLocal)
{
+ mpCurView = maView;
+
mpViewBar->ShowItem(TBI_TEMPLATE_ONLINE);
mpViewBar->HideItem(TBI_TEMPLATE_LOCAL);
@@ -847,6 +851,8 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
}
else
{
+ mpCurView = mpOnlineView;
+
mpViewBar->ShowItem(TBI_TEMPLATE_LOCAL);
mpViewBar->HideItem(TBI_TEMPLATE_ONLINE);
commit 7d2e94d0f8ec8824b3056fc107e29b8ba283e0b3
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sun Jul 15 07:47:31 2012 -0430
Move Populate and ShowOverlay as pure virtual functions.
Change-Id: I6544ec030646a2f9fb0e322c1c2032b78ff6390c
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 21cdd4a..323e125 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -24,6 +24,11 @@ public:
virtual ~TemplateAbstractView ();
+ // Fill view with template folders thumbnails
+ virtual void Populate () = 0;
+
+ virtual void showOverlay (bool bVisible) = 0;
+
// Check if the overlay is visible or not.
bool isOverlayVisible () const;
diff --git a/sfx2/inc/sfx2/templatefolderview.hxx b/sfx2/inc/sfx2/templatefolderview.hxx
index 8e17dd7..5274dd6 100644
--- a/sfx2/inc/sfx2/templatefolderview.hxx
+++ b/sfx2/inc/sfx2/templatefolderview.hxx
@@ -36,11 +36,11 @@ public:
virtual ~TemplateFolderView ();
// Fill view with template folders thumbnails
- void Populate ();
+ virtual void Populate ();
std::vector<rtl::OUString> getFolderNames ();
- void showOverlay (bool bVisible);
+ virtual void showOverlay (bool bVisible);
void filterTemplatesByApp (const FILTER_APPLICATION &eApp);
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index e38ad71..e868248 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -23,7 +23,9 @@ public:
virtual ~TemplateOnlineView ();
// Load repositories from user settings.
- void Populate ();
+ virtual void Populate ();
+
+ virtual void showOverlay (bool bVisible);
void setItemDimensions (long ItemWidth, long ThumbnailHeight, long DisplayHeight, int itemPadding);
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index 7b502a6..a776515 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -87,6 +87,20 @@ void TemplateOnlineView::Populate()
Invalidate();
}
+void TemplateOnlineView::showOverlay (bool bVisible)
+{
+ mbActive = !bVisible;
+ mpItemView->Show(bVisible);
+
+ // Clear items is the overlay is closed.
+ if (!bVisible)
+ {
+ mpItemView->Clear();
+
+ setSelectionMode(mbSelectionMode);
+ }
+}
+
void TemplateOnlineView::setItemDimensions(long ItemWidth, long ThumbnailHeight, long DisplayHeight, int itemPadding)
{
ThumbnailView::setItemDimensions(ItemWidth,ThumbnailHeight,DisplayHeight,itemPadding);
commit 0703d559335588e69599a4172cbc3aa3d153a98f
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 23:01:55 2012 -0430
Move some methods to TemplateAbstractView.
Change-Id: Ie65d5c9c91a1c55c792bf19a9f2ffdb6bb56bb2a
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 580bcbb..21cdd4a 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 e75c49e..8e17dd7 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 ceed5ae..b32bdd2 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 74b330b..3972a49 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
commit 5a22ac8fddd6db9849033b3f7171cf53160e9212
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 20:25:13 2012 -0430
Move overlay attribute from subclasses to TemplateAbstractView.
Change-Id: Ia64c226f481a24c06bb3e248f4441fbbca5ad085
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 1985cd3..580bcbb 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -12,6 +12,8 @@
#include <sfx2/thumbnailview.hxx>
+class TemplateView;
+
class SFX2_DLLPUBLIC TemplateAbstractView : public ThumbnailView
{
public:
@@ -21,6 +23,10 @@ public:
TemplateAbstractView ( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
virtual ~TemplateAbstractView ();
+
+protected:
+
+ TemplateView *mpItemView;
};
#endif // __SFX2_TEMPLATEABSTRACTVIEW_HXX__
diff --git a/sfx2/inc/sfx2/templatefolderview.hxx b/sfx2/inc/sfx2/templatefolderview.hxx
index db4a33a..e75c49e 100644
--- a/sfx2/inc/sfx2/templatefolderview.hxx
+++ b/sfx2/inc/sfx2/templatefolderview.hxx
@@ -17,7 +17,6 @@
class SfxDocumentTemplates;
class TemplateFolderViewItem;
-class TemplateView;
enum FILTER_APPLICATION
{
@@ -87,7 +86,6 @@ private:
bool mbFilteredResults; // Flag keep track if overlay has been filtered so folders can get filtered too afterwards
FILTER_APPLICATION meFilterOption;
SfxDocumentTemplates *mpDocTemplates;
- TemplateView *mpItemView;
Link maTemplateStateHdl;
};
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index 64ff27d..e38ad71 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -14,8 +14,6 @@
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-class TemplateView;
-
class TemplateOnlineView : public TemplateAbstractView
{
public:
@@ -37,7 +35,6 @@ private:
private:
- TemplateView *mpItemView;
com::sun::star::uno::Sequence< rtl::OUString > maUrls;
com::sun::star::uno::Sequence< rtl::OUString > maNames;
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 5fda14f..ceed5ae 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -9,18 +9,23 @@
#include <sfx2/templateabstractview.hxx>
+#include <sfx2/templateview.hxx>
+
TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
- : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren)
+ : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
+ mpItemView(new TemplateView(this))
{
}
TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId &rResId, bool bDisableTransientChildren)
- : ThumbnailView(pParent,rResId,bDisableTransientChildren)
+ : ThumbnailView(pParent,rResId,bDisableTransientChildren),
+ mpItemView(new TemplateView(this))
{
}
TemplateAbstractView::~TemplateAbstractView ()
{
+ delete mpItemView;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx
index 647cb7e..74b330b 100644
--- a/sfx2/source/control/templatefolderview.cxx
+++ b/sfx2/source/control/templatefolderview.cxx
@@ -273,8 +273,7 @@ TemplateFolderView::TemplateFolderView ( Window* pParent, const ResId& rResId, b
: TemplateAbstractView(pParent,rResId,bDisableTransientChildren),
mbFilteredResults(false),
meFilterOption(FILTER_APP_NONE),
- mpDocTemplates(new SfxDocumentTemplates),
- mpItemView(new TemplateView(this))
+ mpDocTemplates(new SfxDocumentTemplates)
{
Size aViewSize = mpItemView->CalcWindowSizePixel(INIT_VIEW_COLS,INIT_VIEW_LINES,
ITEM_MAX_WIDTH,ITEM_MAX_HEIGHT,ITEM_SPACE);
@@ -291,7 +290,6 @@ TemplateFolderView::TemplateFolderView ( Window* pParent, const ResId& rResId, b
TemplateFolderView::~TemplateFolderView()
{
- delete mpItemView;
delete mpDocTemplates;
}
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index 7d81cf4..7b502a6 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -47,8 +47,7 @@ enum
};
TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
- : TemplateAbstractView(pParent,nWinStyle,bDisableTransientChildren),
- mpItemView(new TemplateView(this))
+ : TemplateAbstractView(pParent,nWinStyle,bDisableTransientChildren)
{
mpItemView->SetColor(Color(COL_WHITE));
@@ -61,7 +60,6 @@ TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool
TemplateOnlineView::~TemplateOnlineView ()
{
- delete mpItemView;
}
void TemplateOnlineView::Populate()
commit b2ed25b473ac8914574958a4e01561863dde449f
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 20:14:42 2012 -0430
Remove SfxDocumentTemplates dependency from TemplateView.
Change-Id: I316d14303f3772fe2a3ea72b5b5a733f16b95e5a
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index 04de1ee..d9279b3 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -15,14 +15,13 @@
#include <vcl/image.hxx>
class Edit;
-class SfxDocumentTemplates;
class TemplateViewItem;
class TemplateView : public ThumbnailView
{
public:
- TemplateView (Window *pParent, SfxDocumentTemplates *pTemplates);
+ TemplateView (Window *pParent);
virtual ~TemplateView ();
@@ -60,7 +59,6 @@ private:
bool mbRenderTitle;
sal_uInt16 mnId;
rtl::OUString maName;
- SfxDocumentTemplates *mpDocTemplates;
Link maDblClickHdl;
Link maChangeNameHdl;
Link maCloseHdl;
diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx
index acfdb38..647cb7e 100644
--- a/sfx2/source/control/templatefolderview.cxx
+++ b/sfx2/source/control/templatefolderview.cxx
@@ -274,7 +274,7 @@ TemplateFolderView::TemplateFolderView ( Window* pParent, const ResId& rResId, b
mbFilteredResults(false),
meFilterOption(FILTER_APP_NONE),
mpDocTemplates(new SfxDocumentTemplates),
- mpItemView(new TemplateView(this,mpDocTemplates))
+ mpItemView(new TemplateView(this))
{
Size aViewSize = mpItemView->CalcWindowSizePixel(INIT_VIEW_COLS,INIT_VIEW_LINES,
ITEM_MAX_WIDTH,ITEM_MAX_HEIGHT,ITEM_SPACE);
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index 570a86e..7d81cf4 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -48,7 +48,7 @@ enum
TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: TemplateAbstractView(pParent,nWinStyle,bDisableTransientChildren),
- mpItemView(new TemplateView(this,NULL))
+ mpItemView(new TemplateView(this))
{
mpItemView->SetColor(Color(COL_WHITE));
diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx
index b97fc20..bc13853 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -18,7 +18,6 @@
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
-#include <sfx2/doctempl.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/templateviewitem.hxx>
#include <vcl/edit.hxx>
@@ -32,12 +31,11 @@ using namespace basegfx::tools;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-TemplateView::TemplateView (Window *pParent, SfxDocumentTemplates *pTemplates)
+TemplateView::TemplateView (Window *pParent)
: ThumbnailView(pParent,WB_VSCROLL),
maCloseImg(SfxResId(IMG_TEMPLATE_VIEW_CLOSE)),
mbRenderTitle(true),
mnId(0),
- mpDocTemplates(pTemplates),
mpEditName(new Edit(this, WB_BORDER | WB_HIDE))
{
mnHeaderHeight = 30;
commit 29a0a916f4991d936bf1a648d3f401277b9f5ec8
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 20:09:30 2012 -0430
Refactor setting TemplateView name through regionId.
Change-Id: I4c03c5d254e1552abf8c30fc1f3f5dfbf24c1c84
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index 8e8bc10..04de1ee 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -26,11 +26,13 @@ public:
virtual ~TemplateView ();
- void setRegionId (const sal_uInt16 nRegionId);
+ void setId (const sal_uInt16 nId) { mnId = nId; }
- sal_uInt16 getRegionId () const { return mnRegionId; }
+ sal_uInt16 getId () const { return mnId; }
- const rtl::OUString& getRegionName () const { return maFolderName; }
+ void setName (const rtl::OUString &rName);
+
+ const rtl::OUString& getName () const { return maName; }
virtual void Paint (const Rectangle &rRect);
@@ -56,8 +58,8 @@ private:
Image maCloseImg;
bool mbRenderTitle;
- sal_uInt16 mnRegionId;
- rtl::OUString maFolderName;
+ sal_uInt16 mnId;
+ rtl::OUString maName;
SfxDocumentTemplates *mpDocTemplates;
Link maDblClickHdl;
Link maChangeNameHdl;
diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx
index eb6031d..acfdb38 100644
--- a/sfx2/source/control/templatefolderview.cxx
+++ b/sfx2/source/control/templatefolderview.cxx
@@ -482,7 +482,7 @@ bool TemplateFolderView::removeRegion(const sal_uInt16 nItemId)
bool TemplateFolderView::removeTemplate (const sal_uInt16 nItemId)
{
- sal_uInt16 nRegionId = mpItemView->getRegionId();
+ sal_uInt16 nRegionId = mpItemView->getId();
sal_uInt16 nItemRegionId = nRegionId + 1;
sal_uInt16 nTemplateId = nItemId - 1;
@@ -525,7 +525,7 @@ bool TemplateFolderView::moveTemplates(std::set<const ThumbnailViewItem *> &rIte
bool ret = true;
bool refresh = false;
- sal_uInt16 nSrcRegionId = mpItemView->getRegionId();
+ sal_uInt16 nSrcRegionId = mpItemView->getId();
sal_uInt16 nSrcRegionItemId = nSrcRegionId + 1;
TemplateFolderViewItem *pTarget = NULL;
@@ -665,7 +665,8 @@ void TemplateFolderView::OnItemDblClicked (ThumbnailViewItem *pRegionItem)
// Fill templates
sal_uInt16 nRegionId = pRegionItem->mnId-1;
- mpItemView->setRegionId(nRegionId);
+ mpItemView->setId(nRegionId);
+ mpItemView->setName(mpDocTemplates->GetRegionName(nRegionId));
mpItemView->InsertItems(static_cast<TemplateFolderViewItem*>(pRegionItem)->maTemplates);
if (mbSelectionMode)
@@ -686,17 +687,17 @@ IMPL_LINK(TemplateFolderView, TVTemplateStateHdl, const ThumbnailViewItem*, pIte
IMPL_LINK(TemplateFolderView, ChangeNameHdl, TemplateView*, pView)
{
- sal_uInt16 nRegionId = pView->getRegionId();
+ sal_uInt16 nRegionId = pView->getId();
sal_uInt16 nItemId = nRegionId + 1;
- if (!mpDocTemplates->SetName(pView->getRegionName(),nRegionId,USHRT_MAX))
+ if (!mpDocTemplates->SetName(pView->getName(),nRegionId,USHRT_MAX))
return false;
for (size_t i = 0; i < mItemList.size(); ++i)
{
if (mItemList[i]->mnId == nItemId)
{
- mItemList[i]->maTitle = pView->getRegionName();
+ mItemList[i]->maTitle = pView->getName();
mItemList[i]->calculateItemsPosition(mpItemAttrs->nMaxTextLenght);
Invalidate();
break;
diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx
index a819094..b97fc20 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -36,7 +36,7 @@ TemplateView::TemplateView (Window *pParent, SfxDocumentTemplates *pTemplates)
: ThumbnailView(pParent,WB_VSCROLL),
maCloseImg(SfxResId(IMG_TEMPLATE_VIEW_CLOSE)),
mbRenderTitle(true),
- mnRegionId(0),
+ mnId(0),
mpDocTemplates(pTemplates),
mpEditName(new Edit(this, WB_BORDER | WB_HIDE))
{
@@ -48,10 +48,9 @@ TemplateView::~TemplateView ()
delete mpEditName;
}
-void TemplateView::setRegionId (const sal_uInt16 nRegionId)
+void TemplateView::setName (const rtl::OUString &rName)
{
- mnRegionId = nRegionId;
- maFolderName = mpDocTemplates->GetRegionName(nRegionId);
+ maName = rName;
mpEditName->SetText(rtl::OUString());
}
@@ -74,7 +73,7 @@ void TemplateView::Paint (const Rectangle &rRect)
if (mbRenderTitle)
{
- aPos.X() = (aWinSize.getWidth() - aTextDev.getTextWidth(maFolderName,0,maFolderName.getLength()))/2;
+ aPos.X() = (aWinSize.getWidth() - aTextDev.getTextWidth(maName,0,maName.getLength()))/2;
aPos.Y() = aTextDev.getTextHeight() + (mnHeaderHeight - aTextDev.getTextHeight())/2;
basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix(
@@ -83,7 +82,7 @@ void TemplateView::Paint (const Rectangle &rRect)
aSeq[nCount++] = Primitive2DReference(
new TextSimplePortionPrimitive2D(aTextMatrix,
- maFolderName,0,maFolderName.getLength(),
+ maName,0,maName.getLength(),
std::vector< double >( ),
mpItemAttrs->aFontAttr,
com::sun::star::lang::Locale(),
@@ -188,7 +187,7 @@ void TemplateView::MouseButtonDown (const MouseEvent &rMEvt)
{
drawinglayer::primitive2d::TextLayouterDevice aTextDev;
- float fTextWidth = aTextDev.getTextWidth(maFolderName,0,maFolderName.getLength());
+ float fTextWidth = aTextDev.getTextWidth(maName,0,maName.getLength());
aPos.X() = (aWinSize.getWidth() - fTextWidth)/2;
aPos.Y() = (mnHeaderHeight - aTextDev.getTextHeight())/2;
@@ -215,11 +214,11 @@ void TemplateView::OnItemDblClicked(ThumbnailViewItem *pItem)
IMPL_LINK_NOARG(TemplateView, ChangeNameHdl)
{
- rtl::OUString aTmp = maFolderName;
- maFolderName = mpEditName->GetText();
+ rtl::OUString aTmp = maName;
+ maName = mpEditName->GetText();
if (!maChangeNameHdl.Call(this))
- maFolderName = aTmp;
+ maName = aTmp;
mpEditName->SetText(rtl::OUString());
commit 58a404ca3ae47b2a57e2f50d82e633a0f7184116
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 19:30:35 2012 -0430
Inherit from TemplateAbstractClass instead of ThumbnailView.
Change-Id: If48b413fc4a409fbbce7a0b8c7de99c6b9ce91ad
diff --git a/sfx2/inc/sfx2/templatefolderview.hxx b/sfx2/inc/sfx2/templatefolderview.hxx
index c969a2a..db4a33a 100644
--- a/sfx2/inc/sfx2/templatefolderview.hxx
+++ b/sfx2/inc/sfx2/templatefolderview.hxx
@@ -12,8 +12,8 @@
#include <set>
+#include <sfx2/templateabstractview.hxx>
#include <sfx2/templateproperties.hxx>
-#include <sfx2/thumbnailview.hxx>
class SfxDocumentTemplates;
class TemplateFolderViewItem;
@@ -28,7 +28,7 @@ enum FILTER_APPLICATION
FILTER_APP_DRAW
};
-class SFX2_DLLPUBLIC TemplateFolderView : public ThumbnailView
+class SFX2_DLLPUBLIC TemplateFolderView : public TemplateAbstractView
{
public:
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index c5b26d3..64ff27d 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -10,13 +10,13 @@
#ifndef __SFX2_TEMPLATEONLINEVIEW_HXX__
#define __SFX2_TEMPLATEONLINEVIEW_HXX__
-#include <sfx2/thumbnailview.hxx>
+#include <sfx2/templateabstractview.hxx>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
class TemplateView;
-class TemplateOnlineView : public ThumbnailView
+class TemplateOnlineView : public TemplateAbstractView
{
public:
diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx
index a23114d..eb6031d 100644
--- a/sfx2/source/control/templatefolderview.cxx
+++ b/sfx2/source/control/templatefolderview.cxx
@@ -270,7 +270,7 @@ private:
};
TemplateFolderView::TemplateFolderView ( Window* pParent, const ResId& rResId, bool bDisableTransientChildren)
- : ThumbnailView(pParent,rResId,bDisableTransientChildren),
+ : TemplateAbstractView(pParent,rResId,bDisableTransientChildren),
mbFilteredResults(false),
meFilterOption(FILTER_APP_NONE),
mpDocTemplates(new SfxDocumentTemplates),
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index 379acd3..570a86e 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -47,7 +47,7 @@ enum
};
TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
- : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
+ : TemplateAbstractView(pParent,nWinStyle,bDisableTransientChildren),
mpItemView(new TemplateView(this,NULL))
{
mpItemView->SetColor(Color(COL_WHITE));
commit 4cfb62a8a1e128f32a19d06d46cbd5eda124e9b8
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 18:16:22 2012 -0430
Create abstract class for template repositories.
Change-Id: Ie92c2241c468522439bccd7d9c18a2dbf9c27c38
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 26ac64c..a7689dc 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -133,6 +133,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/control/shell \
sfx2/source/control/sorgitm \
sfx2/source/control/statcach \
+ sfx2/source/control/templateabstractview \
sfx2/source/control/templateview \
sfx2/source/control/templateviewitem \
sfx2/source/control/templatefolderview \
diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk
index 9c0cb5b..c3bfff6 100644
--- a/sfx2/Package_inc.mk
+++ b/sfx2/Package_inc.mk
@@ -118,6 +118,7 @@ $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/taskpane.hxx,sfx2/taskpane.h
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/tbxctrl.hxx,sfx2/tbxctrl.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templdlg.hxx,sfx2/templdlg.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatelocnames.hrc,sfx2/templatelocnames.hrc))
+$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templateabstractview.hxx,sfx2/templateabstractview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templateview.hxx,sfx2/templateview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatefolderview.hxx,sfx2/templatefolderview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatefolderviewitem.hxx,sfx2/templatefolderviewitem.hxx))
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
new file mode 100644
index 0000000..1985cd3
--- /dev/null
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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 __SFX2_TEMPLATEABSTRACTVIEW_HXX__
+#define __SFX2_TEMPLATEABSTRACTVIEW_HXX__
+
+#include <sfx2/thumbnailview.hxx>
+
+class SFX2_DLLPUBLIC TemplateAbstractView : public ThumbnailView
+{
+public:
+
+ TemplateAbstractView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
+
+ TemplateAbstractView ( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+
+ virtual ~TemplateAbstractView ();
+};
+
+#endif // __SFX2_TEMPLATEABSTRACTVIEW_HXX__
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
new file mode 100644
index 0000000..5fda14f
--- /dev/null
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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/.
+ */
+
+#include <sfx2/templateabstractview.hxx>
+
+TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
+ : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren)
+{
+}
+
+TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId &rResId, bool bDisableTransientChildren)
+ : ThumbnailView(pParent,rResId,bDisableTransientChildren)
+{
+}
+
+TemplateAbstractView::~TemplateAbstractView ()
+{
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 65fa0fbb7e3d47afacf95e61e68548f5d50bf8a2
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 16:57:35 2012 -0430
Fill overlay template list when opening an online repository.
Change-Id: I179f93ae76aff059cf069c54fe634eee49d4ed90
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index a71e465..c5b26d3 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -33,6 +33,8 @@ private:
virtual void Resize ();
+ virtual void OnItemDblClicked (ThumbnailViewItem *pItem);
+
private:
TemplateView *mpItemView;
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index 2f336e4..379acd3 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -14,6 +14,8 @@
#include <sfx2/templateonlineviewitem.hxx>
#include <sfx2/templateview.hxx>
#include <sfx2/templateviewitem.hxx>
+#include <svtools/imagemgr.hxx>
+#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
@@ -31,6 +33,19 @@ using namespace com::sun::star::sdbc;
using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
+enum
+{
+ ROW_TITLE = 1,
+ ROW_SIZE,
+ ROW_DATE_MOD,
+ ROW_DATE_CREATE,
+ ROW_IS_DOCUMENT,
+ ROW_TARGET_URL,
+ ROW_IS_HIDDEN,
+ ROW_IS_REMOTE,
+ ROW_IS_REMOVEABLE
+};
+
TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
mpItemView(new TemplateView(this,NULL))
@@ -86,4 +101,111 @@ void TemplateOnlineView::Resize()
mpItemView->SetSizePixel(GetSizePixel());
}
+void TemplateOnlineView::OnItemDblClicked(ThumbnailViewItem *pItem)
+{
+ rtl::OUString aURL = static_cast<TemplateOnlineViewItem*>(pItem)->getURL();
+
+ try
+ {
+
+ uno::Sequence< rtl::OUString > aProps(9);
+
+ aProps[0] = "Title";
+ aProps[1] = "Size";
+ aProps[2] = "DateModified";
+ aProps[3] = "DateCreated";
+ aProps[4] = "IsDocument";
+ aProps[5] = "TargetURL";
+ aProps[6] = "IsHidden";
+ aProps[7] = "IsRemote";
+ aProps[8] = "IsRemoveable";
+
+ ucbhelper::Content aContent(aURL,m_xCmdEnv);
+
+ uno::Reference< XResultSet > xResultSet;
+ uno::Reference< XDynamicResultSet > xDynResultSet;
+
+ ucbhelper::ResultSetInclude eInclude = ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
+ xDynResultSet = aContent.createDynamicCursor( aProps, eInclude );
+
+ if ( xDynResultSet.is() )
+ xResultSet = xDynResultSet->getStaticResultSet();
+
+ if ( xResultSet.is() )
+ {
+ uno::Reference< XRow > xRow( xResultSet, UNO_QUERY );
+ uno::Reference< XContentAccess > xContentAccess( xResultSet, UNO_QUERY );
+
+ util::DateTime aDT;
+ std::vector<TemplateItemProperties> aItems;
+
+ sal_uInt16 nIdx = 0;
+ while ( xResultSet->next() )
+ {
+ bool bIsDocument = xRow->getBoolean( ROW_IS_DOCUMENT ) && !xRow->wasNull();
+ bool bIsHidden = xRow->getBoolean( ROW_IS_HIDDEN );
+
+ // don't show hidden files or anything besides documents
+ if ( bIsDocument && (!bIsHidden || xRow->wasNull()) )
+ {
+ aDT = xRow->getTimestamp( ROW_DATE_MOD );
+ bool bContainsDate = !xRow->wasNull();
+
+ if ( !bContainsDate )
+ {
+ aDT = xRow->getTimestamp( ROW_DATE_CREATE );
+ bContainsDate = !xRow->wasNull();
+ }
+
+ rtl::OUString aContentURL = xContentAccess->queryContentIdentifierString();
+ rtl::OUString aTargetURL = xRow->getString( ROW_TARGET_URL );
+ bool bHasTargetURL = !xRow->wasNull() && !aTargetURL.isEmpty();
+
+ rtl::OUString sRealURL = bHasTargetURL ? aTargetURL : aContentURL;
+
+ TemplateItemProperties aTemplateItem;
+ aTemplateItem.nId = nIdx+1;
+ aTemplateItem.nRegionId = pItem->mnId-1;
+ aTemplateItem.aPath = sRealURL;
+// pData->mbIsRemote = xRow->getBoolean( ROW_IS_REMOTE ) && !xRow->wasNull();
+// pData->mbIsRemoveable = xRow->getBoolean( ROW_IS_REMOVEABLE ) && !xRow->wasNull();
+ aTemplateItem.aName = xRow->getString( ROW_TITLE );
+// pData->maSize = xRow->getLong( ROW_SIZE );
+
+ if ( bHasTargetURL &&
+ INetURLObject( aContentURL ).GetProtocol() == INET_PROT_VND_SUN_STAR_HIER )
+ {
+ ucbhelper::Content aCnt( aTargetURL, m_xCmdEnv );
+
+ try
+ {
+// aCnt.getPropertyValue("Size") >>= pData->maSize;
+ aCnt.getPropertyValue("DateModified") >>= aDT;
+ }
+ catch (...)
+ {}
+ }
+
+ aTemplateItem.aType = SvFileInformationManager::GetFileDescription(INetURLObject(sRealURL));
+
+ aItems.push_back(aTemplateItem);
+ ++nIdx;
+ }
+ }
+
+ mpItemView->InsertItems(aItems);
+ mpItemView->Show();
+ }
+ }
+ catch( ucb::CommandAbortedException& )
+ {
+ }
+ catch( uno::RuntimeException& )
+ {
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6876faeee8d8ecf66ef33bfe1f436117a71753e8
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 16:56:37 2012 -0430
Set online overlay dimensions the same as parent and set bg as white.
Change-Id: I40e84c1c10369a48544ccc1fcc9bb1821c8b3e23
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index 69b4425..a71e465 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -36,7 +36,6 @@ private:
private:
TemplateView *mpItemView;
-
com::sun::star::uno::Sequence< rtl::OUString > maUrls;
com::sun::star::uno::Sequence< rtl::OUString > maNames;
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index fb46bc0..2f336e4 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -13,15 +13,21 @@
#include <officecfg/Office/Common.hxx>
#include <sfx2/templateonlineviewitem.hxx>
#include <sfx2/templateview.hxx>
+#include <sfx2/templateviewitem.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/ucb/XContentAccess.hpp>
+#include <com/sun/star/ucb/XDynamicResultSet.hpp>
using namespace com::sun::star;
using namespace com::sun::star::lang;
using namespace com::sun::star::task;
+using namespace com::sun::star::sdbc;
using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
@@ -29,7 +35,7 @@ TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
mpItemView(new TemplateView(this,NULL))
{
- mpItemView->SetPosPixel(Point(0,0));
+ mpItemView->SetColor(Color(COL_WHITE));
Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >(
commit 836822522a2e9f009c0870cbbcd48d45bbd3c622
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 15:53:42 2012 -0430
Create overlay for online templates.
Change-Id: Ie09c91e23527d3e1389fc13bd13a8234bda080f3
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index 70e8989..69b4425 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -14,6 +14,8 @@
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+class TemplateView;
+
class TemplateOnlineView : public ThumbnailView
{
public:
@@ -25,8 +27,16 @@ public:
// Load repositories from user settings.
void Populate ();
+ void setItemDimensions (long ItemWidth, long ThumbnailHeight, long DisplayHeight, int itemPadding);
+
+private:
+
+ virtual void Resize ();
+
private:
+ TemplateView *mpItemView;
+
com::sun::star::uno::Sequence< rtl::OUString > maUrls;
com::sun::star::uno::Sequence< rtl::OUString > maNames;
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index bb6c5d8..fb46bc0 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -12,6 +12,7 @@
#include <comphelper/processfactory.hxx>
#include <officecfg/Office/Common.hxx>
#include <sfx2/templateonlineviewitem.hxx>
+#include <sfx2/templateview.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
@@ -25,8 +26,11 @@ using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
- : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren)
+ : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
+ mpItemView(new TemplateView(this,NULL))
{
+ mpItemView->SetPosPixel(Point(0,0));
+
Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >(
xFactory->createInstance("com.sun.star.task.InteractionHandler" ), UNO_QUERY );
@@ -36,6 +40,7 @@ TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool
TemplateOnlineView::~TemplateOnlineView ()
{
+ delete mpItemView;
}
void TemplateOnlineView::Populate()
@@ -63,4 +68,16 @@ void TemplateOnlineView::Populate()
Invalidate();
}
+void TemplateOnlineView::setItemDimensions(long ItemWidth, long ThumbnailHeight, long DisplayHeight, int itemPadding)
+{
+ ThumbnailView::setItemDimensions(ItemWidth,ThumbnailHeight,DisplayHeight,itemPadding);
+
+ mpItemView->setItemDimensions(ItemWidth,ThumbnailHeight,DisplayHeight,itemPadding);
+}
+
+void TemplateOnlineView::Resize()
+{
+ mpItemView->SetSizePixel(GetSizePixel());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e81b42750c47ccda313792f6a33ce8283470106e
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 11:06:50 2012 -0430
Store item url in TemplateOnlineViewItem.
Change-Id: Icc825963591fbdee4e75fc9865333d5ea52d6301
diff --git a/sfx2/inc/sfx2/templateonlineviewitem.hxx b/sfx2/inc/sfx2/templateonlineviewitem.hxx
index aa5cdec..1d9f9cd 100644
--- a/sfx2/inc/sfx2/templateonlineviewitem.hxx
+++ b/sfx2/inc/sfx2/templateonlineviewitem.hxx
@@ -19,6 +19,14 @@ public:
TemplateOnlineViewItem (ThumbnailView &rView, Window *pParent);
virtual ~TemplateOnlineViewItem ();
+
+ void setURL (const rtl::OUString &rURL) { maUrl = rURL; }
+
+ const rtl::OUString& getURL () const { return maUrl; }
+
+private:
+
+ rtl::OUString maUrl;
};
#endif // __SFX2_TEMPLATEONLINEVIEWITEM_HXX__
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index 8ccc56b..bb6c5d8 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -52,6 +52,7 @@ void TemplateOnlineView::Populate()
pItem->mnId = i+1;
pItem->maTitle = maNames[i];
+ pItem->setURL(maUrls[i]);
mItemList.push_back(pItem);
}
commit 02cf240b0823f9337295cc6a72280ed83d37777a
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 10:38:53 2012 -0430
Load user saved repositories when loading dialog.
Change-Id: Id5ffb1d4addec43ba8c6fa5aecfa3d5683d6c3a0
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 041b72c..6555d7e 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -233,6 +233,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
switchMainView(true);
+ mpOnlineView->Populate();
+
maView->Populate();
maView->Show();
commit 86d59ae04eb77cf7b2c88c7f469bed2fe30edea0
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 10:37:11 2012 -0430
Set online view position, dimensions and item details.
Change-Id: I968eecdbc91b8998f3fb579afb5305554d6dab76
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index a2359cc..041b72c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -190,6 +190,14 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
maView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
maView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl));
+ // Set online view position and dimensions
+ mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize);
+ mpOnlineView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
+
+ mpOnlineView->setItemDimensions(ITEM_MAX_WIDTH,THUMBNAIL_MAX_HEIGHT,
+ ITEM_MAX_HEIGHT-THUMBNAIL_MAX_HEIGHT,
+ ITEM_PADDING);
+
mpSearchView->SetSizePixel(aThumbSize);
mpSearchView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
commit 6c034219f3b0d2576b3261a4e9ba5c4d79b1ed91
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sat Jul 14 09:19:57 2012 -0430
Load repositories URLs and names from user settings.
Change-Id: Iad7f62660abc59383d9933b198a57ac317361f38
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index c442df8..26ac64c 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -138,6 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/control/templatefolderview \
sfx2/source/control/templatefolderviewitem \
sfx2/source/control/templateonlineview \
+ sfx2/source/control/templateonlineviewitem \
sfx2/source/control/templatesearchview \
sfx2/source/control/thumbnailviewitem \
sfx2/source/control/thumbnailviewacc \
diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk
index b06adab..9c0cb5b 100644
--- a/sfx2/Package_inc.mk
+++ b/sfx2/Package_inc.mk
@@ -122,6 +122,7 @@ $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templateview.hxx,sfx2/templa
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatefolderview.hxx,sfx2/templatefolderview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatefolderviewitem.hxx,sfx2/templatefolderviewitem.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templateonlineview.hxx,sfx2/templateonlineview.hxx))
+$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templateonlineviewitem.hxx,sfx2/templateonlineviewitem.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/thumbnailview.hxx,sfx2/thumbnailview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/thumbnailviewitem.hxx,sfx2/thumbnailviewitem.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/titledockwin.hxx,sfx2/titledockwin.hxx))
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
index 7345df0..70e8989 100644
--- a/sfx2/inc/sfx2/templateonlineview.hxx
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -12,6 +12,8 @@
#include <sfx2/thumbnailview.hxx>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+
class TemplateOnlineView : public ThumbnailView
{
public:
@@ -19,6 +21,15 @@ public:
TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
virtual ~TemplateOnlineView ();
+
+ // Load repositories from user settings.
+ void Populate ();
+
+private:
+
+ com::sun::star::uno::Sequence< rtl::OUString > maUrls;
+ com::sun::star::uno::Sequence< rtl::OUString > maNames;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
};
#endif // __SFX2_TEMPLATEONLINEVIEW_HXX__
diff --git a/sfx2/inc/sfx2/templateonlineviewitem.hxx b/sfx2/inc/sfx2/templateonlineviewitem.hxx
new file mode 100644
index 0000000..aa5cdec
--- /dev/null
+++ b/sfx2/inc/sfx2/templateonlineviewitem.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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 __SFX2_TEMPLATEONLINEVIEWITEM_HXX__
+#define __SFX2_TEMPLATEONLINEVIEWITEM_HXX__
+
+#include <sfx2/thumbnailviewitem.hxx>
+
+class TemplateOnlineViewItem : public ThumbnailViewItem
+{
+public:
+
+ TemplateOnlineViewItem (ThumbnailView &rView, Window *pParent);
+
+ virtual ~TemplateOnlineViewItem ();
+};
+
+#endif // __SFX2_TEMPLATEONLINEVIEWITEM_HXX__
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
index cc06e59..8ccc56b 100644
--- a/sfx2/source/control/templateonlineview.cxx
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -9,13 +9,57 @@
#include <sfx2/templateonlineview.hxx>
+#include <comphelper/processfactory.hxx>
+#include <officecfg/Office/Common.hxx>
+#include <sfx2/templateonlineviewitem.hxx>
+#include <ucbhelper/content.hxx>
+#include <ucbhelper/commandenvironment.hxx>
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+
+using namespace com::sun::star;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::task;
+using namespace com::sun::star::ucb;
+using namespace com::sun::star::uno;
+
TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren)
{
+ Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >(
+ xFactory->createInstance("com.sun.star.task.InteractionHandler" ), UNO_QUERY );
+
+ m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() );
}
TemplateOnlineView::~TemplateOnlineView ()
{
}
+void TemplateOnlineView::Populate()
+{
+ uno::Reference < uno::XComponentContext > m_context(comphelper::getProcessComponentContext());
+
+ // Load from user settings
+ maUrls = officecfg::Office::Common::Misc::FilePickerPlacesUrls::get(m_context);
+ maNames = officecfg::Office::Common::Misc::FilePickerPlacesNames::get(m_context);
+
+ for (sal_Int32 i = 0; i < maUrls.getLength() && i < maNames.getLength(); ++i)
+ {
+ TemplateOnlineViewItem *pItem = new TemplateOnlineViewItem(*this,this);
+
+ pItem->mnId = i+1;
+ pItem->maTitle = maNames[i];
+
+ mItemList.push_back(pItem);
+ }
+
+ CalculateItemPositions();
+
+ if (IsReallyVisible() && IsUpdateMode())
+ Invalidate();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateonlineviewitem.cxx b/sfx2/source/control/templateonlineviewitem.cxx
new file mode 100644
index 0000000..e874a3d
--- /dev/null
+++ b/sfx2/source/control/templateonlineviewitem.cxx
@@ -0,0 +1,21 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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/.
+ */
+
+#include <sfx2/templateonlineviewitem.hxx>
+
+TemplateOnlineViewItem::TemplateOnlineViewItem (ThumbnailView &rView, Window *pParent)
+ : ThumbnailViewItem(rView,pParent)
+{
+}
+
+TemplateOnlineViewItem::~TemplateOnlineViewItem()
+{
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e64f770707b3e677d0ba337b1b0d35937a691882
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Fri Jul 13 21:31:48 2012 -0430
Switch main view between local/online repository.
Change-Id: If2f5f53991271fc05453c44fa422aba7c14d0e16
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 435b436..307922d 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -18,6 +18,7 @@
class Edit;
class PopupMenu;
class TemplateFolderView;
+class TemplateOnlineView;
class TemplateSearchView;
class ThumbnailView;
class ThumbnailViewItem;
@@ -76,6 +77,9 @@ private:
void centerTopButtons ();
+ // Exchange view between local/online view.
+ void switchMainView (bool bDisplayLocal);
+
private:
PushButton aButtonAll;
@@ -92,6 +96,7 @@ private:
ToolBox *mpTemplateBar;
TemplateSearchView *mpSearchView;
TemplateFolderView *maView;
+ TemplateOnlineView *mpOnlineView;
PopupMenu *mpCreateMenu;
PopupMenu *mpActionMenu;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index de48d57..a2359cc 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -17,6 +17,7 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatefolderview.hxx>
#include <sfx2/templatefolderviewitem.hxx>
+#include <sfx2/templateonlineview.hxx>
#include <sfx2/templateviewitem.hxx>
#include <sfx2/thumbnailviewitem.hxx>
#include <tools/urlobj.hxx>
@@ -97,6 +98,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpTemplateBar( new ToolBox(this, SfxResId(TBX_ACTION_TEMPLATES))),
mpSearchView(new TemplateSearchView(this)),
maView(new TemplateFolderView(this,SfxResId(TEMPLATE_VIEW))),
+ mpOnlineView(new TemplateOnlineView(this, WB_VSCROLL,false)),
mnSelectionCount(0),
mxDesktop(comphelper::getProcessServiceFactory()->createInstance( "com.sun.star.frame.Desktop" ),uno::UNO_QUERY )
{
@@ -221,6 +223,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpViewBar->Show();
mpActionBar->Show();
+ switchMainView(true);
+
maView->Populate();
maView->Show();
@@ -235,6 +239,7 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg ()
delete mpTemplateBar;
delete mpSearchView;
delete maView;
+ delete mpOnlineView;
delete mpCreateMenu;
delete mpActionMenu;
}
@@ -313,6 +318,12 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXViewHdl)
case TBI_TEMPLATE_FOLDER_DEL:
OnFolderDelete();
break;
+ case TBI_TEMPLATE_LOCAL:
+ switchMainView(true);
+ break;
+ case TBI_TEMPLATE_ONLINE:
+ switchMainView(false);
+ break;
default:
break;
}
@@ -814,6 +825,26 @@ void SfxTemplateManagerDlg::centerTopButtons()
maButtonSelMode.SetPosPixel(aBtnPos);
}
+void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
+{
+ if (bDisplayLocal)
+ {
+ mpViewBar->ShowItem(TBI_TEMPLATE_ONLINE);
+ mpViewBar->HideItem(TBI_TEMPLATE_LOCAL);
+
+ mpOnlineView->Hide();
+ maView->Show();
+ }
+ else
+ {
+ mpViewBar->ShowItem(TBI_TEMPLATE_LOCAL);
+ mpViewBar->HideItem(TBI_TEMPLATE_ONLINE);
+
+ maView->Hide();
+ mpOnlineView->Show();
+ }
+}
+
void lcl_createTemplate(uno::Reference< com::sun::star::frame::XComponentLoader > xDesktop,
const FILTER_APPLICATION eApp)
{
commit 63cddab83b1217845c57e37a6e8d3a9a28adc6e3
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Fri Jul 13 19:27:28 2012 -0430
Create toolbox buttons to display local/online templates.
Change-Id: Ia1445813c0c049b3478c3873b9e1acf5ae8d67f6
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index 509b925..fd94bc0 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -39,6 +39,8 @@
#define BTN_TEMPLATE_CLOSE 24
#define TBI_TEMPLATE_FOLDER_DEL 25
+#define TBI_TEMPLATE_LOCAL 26
+#define TBI_TEMPLATE_ONLINE 27
#define STR_CREATE_TEXT 260
#define STR_CREATE_SHEET 261
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index f32e26c..2681200 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -187,6 +187,18 @@ ModalDialog DLG_TEMPLATE_MANAGER
ToolBoxItem
{
+ Identifier = TBI_TEMPLATE_LOCAL;
+ Text [ en-US ] = "Local Templates";
+ };
+
+ ToolBoxItem
+ {
+ Identifier = TBI_TEMPLATE_ONLINE;
+ Text [ en-US ] = "Online Templates";
+ };
+
+ ToolBoxItem
+ {
Identifier = TBI_TEMPLATE_IMPORT ;
Text [ en-US ] = "Import a template" ;
commit 7db5c56b9f073eb416cf6038078d01bcc64f7ef2
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Fri Jul 13 17:47:55 2012 -0430
Create a class to display online templates thumbnails.
Change-Id: Id1a2a18d5531a3425221adec84abb7c05228496c
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 06fd4b6..c442df8 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -137,6 +137,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/control/templateviewitem \
sfx2/source/control/templatefolderview \
sfx2/source/control/templatefolderviewitem \
+ sfx2/source/control/templateonlineview \
sfx2/source/control/templatesearchview \
sfx2/source/control/thumbnailviewitem \
sfx2/source/control/thumbnailviewacc \
diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk
index aa9d371..b06adab 100644
--- a/sfx2/Package_inc.mk
+++ b/sfx2/Package_inc.mk
@@ -121,6 +121,7 @@ $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatelocnames.hrc,sfx2/te
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templateview.hxx,sfx2/templateview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatefolderview.hxx,sfx2/templatefolderview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatefolderviewitem.hxx,sfx2/templatefolderviewitem.hxx))
+$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templateonlineview.hxx,sfx2/templateonlineview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/thumbnailview.hxx,sfx2/thumbnailview.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/thumbnailviewitem.hxx,sfx2/thumbnailviewitem.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/titledockwin.hxx,sfx2/titledockwin.hxx))
diff --git a/sfx2/inc/sfx2/templateonlineview.hxx b/sfx2/inc/sfx2/templateonlineview.hxx
new file mode 100644
index 0000000..7345df0
--- /dev/null
+++ b/sfx2/inc/sfx2/templateonlineview.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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 __SFX2_TEMPLATEONLINEVIEW_HXX__
+#define __SFX2_TEMPLATEONLINEVIEW_HXX__
+
+#include <sfx2/thumbnailview.hxx>
+
+class TemplateOnlineView : public ThumbnailView
+{
+public:
+
+ TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
+
+ virtual ~TemplateOnlineView ();
+};
+
+#endif // __SFX2_TEMPLATEONLINEVIEW_HXX__
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateonlineview.cxx b/sfx2/source/control/templateonlineview.cxx
new file mode 100644
index 0000000..cc06e59
--- /dev/null
+++ b/sfx2/source/control/templateonlineview.cxx
@@ -0,0 +1,21 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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/.
+ */
+
+#include <sfx2/templateonlineview.hxx>
+
+TemplateOnlineView::TemplateOnlineView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
+ : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren)
+{
+}
+
+TemplateOnlineView::~TemplateOnlineView ()
+{
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list