summaryrefslogtreecommitdiff
path: root/include/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-04-27 01:21:50 +0200
committerJan Holesovsky <kendy@collabora.com>2014-04-27 01:30:51 +0200
commit60cd850d672bc1dcc3eb24adfffa7a6ab98a44bd (patch)
treef83bc715cf2964476eb53e0be307418d246c5b3b /include/sfx2
parent978ba69d33cf31cd334f18af5215166dd3926402 (diff)
startcenter: Add possibility to selectively remove recent documents.
Change-Id: Id0c20de6dc3375e64dd3dbef34dcd6eb77f02340
Diffstat (limited to 'include/sfx2')
-rw-r--r--include/sfx2/recentdocsview.hxx15
-rw-r--r--include/sfx2/recentdocsviewitem.hxx25
-rw-r--r--include/sfx2/thumbnailview.hxx13
-rw-r--r--include/sfx2/thumbnailviewitem.hxx10
4 files changed, 52 insertions, 11 deletions
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index ca7dd23013c1..c1ba062a7fee 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -38,15 +38,13 @@ enum ApplicationType
};
-class SFX2_DLLPUBLIC RecentDocsView : protected ::comphelper::OBaseMutex,
- public ThumbnailView
+class SFX2_DLLPUBLIC RecentDocsView : public ThumbnailView
{
public:
RecentDocsView( Window* pParent );
virtual ~RecentDocsView();
void insertItem(const OUString &rURL, const OUString &rTitle, const BitmapEx &rThumbnail, sal_uInt16 nId);
- void loadRecentDocs();
long GetThumbnailSize() const;
@@ -57,12 +55,18 @@ public:
virtual void Clear() SAL_OVERRIDE;
+ /// Update the information in the view.
+ virtual void Reload() SAL_OVERRIDE;
+
DECL_STATIC_LINK( RecentDocsView, ExecuteHdl_Impl, LoadRecentFile* );
protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+
+ virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+
virtual void OnItemDblClicked(ThumbnailViewItem *pItem) SAL_OVERRIDE;
- void OpenItem( const ThumbnailViewItem *pItem );
+
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
@@ -74,7 +78,8 @@ protected:
long mnItemPadding;
long mnItemMaxTextLength;
- Image maWelcomeImage;
+ /// Image that appears when there is no recent document.
+ Image maWelcomeImage;
OUString maWelcomeLine1;
OUString maWelcomeLine2;
};
diff --git a/include/sfx2/recentdocsviewitem.hxx b/include/sfx2/recentdocsviewitem.hxx
index e074296dca46..96cd84c12160 100644
--- a/include/sfx2/recentdocsviewitem.hxx
+++ b/include/sfx2/recentdocsviewitem.hxx
@@ -19,13 +19,36 @@ public:
const OUString &rTitle, const BitmapEx& rThumbnail, sal_uInt16 nId);
virtual void setEditTitle (bool edit, bool bChangeFocus = true) SAL_OVERRIDE;
+ /** Updates own highlight status based on the aPoint position.
+
+ Calls the ancestor's updateHighlight, and then takes care of m_bRemoveIconHighlighted.
+
+ Returns rectangle that needs to be invalidated.
+ */
+ virtual Rectangle updateHighlight(bool bVisible, const Point& rPoint) SAL_OVERRIDE;
+
/// Text to be used for the tooltip.
virtual OUString getHelpText() const SAL_OVERRIDE;
- OUString maURL;
+ virtual void Paint(drawinglayer::processor2d::BaseProcessor2D *pProcessor,
+ const ThumbnailItemAttributes *pAttrs);
+
+ virtual void MouseButtonUp(const MouseEvent& rMEvt);
+
+ /// Called when the user clicks a document - it will open it.
+ void OpenDocument();
+
+protected:
+ /// Return area where is the icon to remove document from the recent documents.
+ Rectangle getRemoveIconArea() const;
private:
+ OUString maURL;
+
OUString m_sHelpText;
+
+ /// Is the icon that the user can click to remove the document from the recent documents highlighted?
+ bool m_bRemoveIconHighlighted;
};
#endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 068c01e32b5d..b7604266b4fd 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -180,18 +180,21 @@ class SFX2_DLLPUBLIC ThumbnailView : public Control
{
public:
- ThumbnailView ( Window* pParent, WinBits nWinStyle = WB_TABSTOP, bool bDisableTransientChildren = false );
+ ThumbnailView(Window* pParent, WinBits nWinStyle = WB_TABSTOP, bool bDisableTransientChildren = false);
- virtual ~ThumbnailView ();
+ virtual ~ThumbnailView();
- virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
- void AppendItem (ThumbnailViewItem *pItem);
+ void AppendItem(ThumbnailViewItem *pItem);
- void RemoveItem( sal_uInt16 nItemId );
+ void RemoveItem(sal_uInt16 nItemId);
virtual void Clear();
+ /// Updates information in the view; used only in RecentDocsView ATM.
+ virtual void Reload() {}
+
// Change current thumbnail item list with new one (invalidates all pointers to a thumbnail item)
void updateItems(const std::vector<ThumbnailViewItem *> &items);
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index eea0e4539d93..ee4fd7fa75aa 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -32,6 +32,8 @@
#define THUMBNAILVIEW_ITEM_NONEITEM 0xFFFE
+const int THUMBNAILVIEW_ITEM_CORNER = 5;
+
class CheckBox;
class Font;
class Window;
@@ -89,6 +91,12 @@ public:
void setHighlight (bool state);
+ /** Updates own highlight status based on the aPoint position.
+
+ Returns rectangle that needs to be invalidated.
+ */
+ virtual Rectangle updateHighlight(bool bVisible, const Point& rPoint);
+
/// Text to be used for the tooltip.
virtual OUString getHelpText() const;
@@ -121,6 +129,8 @@ public:
static drawinglayer::primitive2d::PolygonHairlinePrimitive2D*
createBorderLine (const basegfx::B2DPolygon &rPolygon);
+ virtual void MouseButtonUp(const MouseEvent&) {}
+
protected:
Point maTextPos;