ginebra2/TitleUrlContainerSnippet.h
changeset 16 3c88a81ff781
parent 12 afcd8e6d025b
--- a/ginebra2/TitleUrlContainerSnippet.h	Thu Sep 23 15:32:11 2010 -0400
+++ b/ginebra2/TitleUrlContainerSnippet.h	Fri Oct 15 17:30:59 2010 -0400
@@ -24,6 +24,7 @@
 #include <QtGui>
 #include "ChromeSnippet.h"
 #include "NativeChromeItem.h"
+#include "UrlSearchSnippet.h"
 
 namespace GVA {
 
@@ -45,6 +46,11 @@
         
         /// The URL of the web page.
         QString url() const;
+        void cut();
+        void copy();
+        void paste();
+        void setContextMenuStatus(bool on);
+        void setFocusForEditor() { m_urlTileWidget->setFocusForEditor(); }
 
     protected:
         virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);
@@ -53,6 +59,9 @@
     private Q_SLOTS:
         void onChromeResize();
         void changeLayout(bool editMode);
+        
+    Q_SIGNALS:
+        void contextEvent(bool);
 
     private:
         void setProperties();
@@ -64,7 +73,6 @@
         GUrlSearchItem * m_urlTileWidget;
         QGraphicsPixmapItem * m_dividerImage;
         // painting support
-        QPen m_pen;
         QLinearGradient m_grad;
 };
 
@@ -86,6 +94,22 @@
         /// The URL of the web page.
         QString url() const;
         Q_PROPERTY(QString url READ url)
+
+    Q_SIGNALS:
+          void contextEvent(bool isContentSelected, QString snippetId);
+
+    public slots:
+        void cut() { titleUrlContainerItem()->cut(); }
+        void copy() { titleUrlContainerItem()->copy(); }
+        void paste(){ titleUrlContainerItem()->paste(); }
+        bool editable() { return true; }
+        bool useNativeCopyPasteMenu() { return true; }
+        void sendContextMenuEvent(bool isContentSelected);
+        void setContextMenuStatus(bool on) { titleUrlContainerItem()->setContextMenuStatus(on); }
+        void grabFocus() { titleUrlContainerItem()->setFocusForEditor(); }
+
+    private:
+        TitleUrlContainerItem * titleUrlContainerItem() { return qobject_cast<TitleUrlContainerItem*> (widget());} 
 };
 
 } // end of namespace GVA