summaryrefslogtreecommitdiff
path: root/sfx2/inc
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-02-11 15:30:16 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-02-11 15:39:48 +0100
commitd4617cf434844f15c7be29ecc95edf0b4e384e67 (patch)
treee42462e6b373b65e3f7172d235d381f4d47d12c1 /sfx2/inc
parent7b384313399ee8199cd7241527c3dbc1d50694a2 (diff)
Templates Manager: UI for renaming templates and folders, fdo#60579
After thinking this was a feature regression, I finally discovered that the old template manager couldn't rename templates. This commit is bringing back some previously unused code dropped in an ealier commit. Even though this is a UI change, no new string is added by this commit.
Diffstat (limited to 'sfx2/inc')
-rw-r--r--sfx2/inc/sfx2/doctempl.hxx15
-rw-r--r--sfx2/inc/sfx2/templatelocalview.hxx2
-rw-r--r--sfx2/inc/sfx2/templateview.hxx3
-rw-r--r--sfx2/inc/sfx2/templateviewitem.hxx4
-rw-r--r--sfx2/inc/sfx2/thumbnailview.hxx2
-rw-r--r--sfx2/inc/sfx2/thumbnailviewitem.hxx9
6 files changed, 35 insertions, 0 deletions
diff --git a/sfx2/inc/sfx2/doctempl.hxx b/sfx2/inc/sfx2/doctempl.hxx
index 01d398f1aa7c..54e53c6983a8 100644
--- a/sfx2/inc/sfx2/doctempl.hxx
+++ b/sfx2/inc/sfx2/doctempl.hxx
@@ -92,6 +92,21 @@ public:
sal_Bool Delete(sal_uInt16 nRegion, sal_uInt16 nIdx);
sal_Bool InsertDir(const String &rText, sal_uInt16 nRegion);
+ /** Change the name of an entry or a directory
+
+ \param rName
+ The new name to set
+ \param nRegion
+ The id of the region to rename or containing the template to rename
+ \param nIdx
+ The id of the template to rename or USHRT_MAX to rename the region.
+
+ \return
+ sal_True if the action could be performed, sal_False otherwise
+
+ */
+ sal_Bool SetName(const rtl::OUString &rName, sal_uInt16 nRegion, sal_uInt16 nIdx);
+
sal_Bool CopyTo(sal_uInt16 nRegion, sal_uInt16 nIdx, const String &rName) const;
sal_Bool CopyFrom(sal_uInt16 nRegion, sal_uInt16 nIdx, String &rName);
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index 5c54375a4935..c27659f90b63 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -68,6 +68,8 @@ public:
const OUString &rName);
bool isTemplateNameUnique (const sal_uInt16 nRegionItemId, const OUString &rName) const;
+
+ virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
private:
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index 8ee529d707ec..81582efc904c 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -42,6 +42,8 @@ public:
// FIXME Kept only during the refactoring
void setOpenHdl (const Link &rLink) { maOpenHdl = rLink; }
virtual void OnItemDblClicked(ThumbnailViewItem *pItem) { maOpenHdl.Call(pItem); }
+ void setMasterView(TemplateAbstractView* pMasterView) { mpMasterView = pMasterView; }
+ virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
protected:
@@ -50,6 +52,7 @@ protected:
private:
Link maOpenHdl;
+ TemplateAbstractView* mpMasterView;
Control maButtons;
PushButton maAllButton;
diff --git a/sfx2/inc/sfx2/templateviewitem.hxx b/sfx2/inc/sfx2/templateviewitem.hxx
index b19a06060421..0a3cb3e10b44 100644
--- a/sfx2/inc/sfx2/templateviewitem.hxx
+++ b/sfx2/inc/sfx2/templateviewitem.hxx
@@ -42,6 +42,10 @@ public:
virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
const ThumbnailItemAttributes *pAttrs);
+
+ sal_uInt16 mnRegionId;
+ sal_uInt16 mnDocId;
+
private:
rtl::OUString maPath;
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx
index bc5aae95763c..78e1df6bf6ef 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -236,6 +236,8 @@ public:
virtual void Resize();
+ virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
+
protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt );
diff --git a/sfx2/inc/sfx2/thumbnailviewitem.hxx b/sfx2/inc/sfx2/thumbnailviewitem.hxx
index 18b7eae57f90..2acc8de9f9e3 100644
--- a/sfx2/inc/sfx2/thumbnailviewitem.hxx
+++ b/sfx2/inc/sfx2/thumbnailviewitem.hxx
@@ -25,6 +25,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <osl/mutex.hxx>
#include <vcl/bitmapex.hxx>
+#include <vcl/vclmedit.hxx>
#include "sfx2/dllapi.h"
#include <com/sun/star/accessibility/XAccessible.hpp>
@@ -88,12 +89,17 @@ public:
void setHighlight (bool state);
+ void setEditTitle (bool edit, bool bChangeFocus = true);
+ void updateTitleEditSize ();
+ virtual void setTitle (const rtl::OUString& rTitle);
+
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
GetAccessible( bool bIsTransientChildrenDisabled );
void setDrawArea (const Rectangle &area);
const Rectangle& getDrawArea () const { return maDrawArea; }
+ Rectangle getTextArea () const;
virtual void calculateItemsPosition (const long nThumbnailHeight, const long nDisplayHeight,
const long nPadding, sal_uInt32 nMaxTextLenght,
@@ -118,6 +124,9 @@ protected:
Point maPrev1Pos;
Rectangle maDrawArea;
Link maClickHdl;
+ bool mbEditTitle;
+ VclMultiLineEdit* mpTitleED;
+ Rectangle maTextEditMaxArea;
};
#endif // THUMBNAILVIEWITEM_HXX