summaryrefslogtreecommitdiff
path: root/src/frontend/mainindex/bookmarks/cbookmarkindex.h
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:29 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:29 -0400
commite8a196082586bb68e0bf254a8f6f4b8f39071f32 (patch)
treeb03dbbd1b5be6092ed5e9bcb3806aa2d4938bba3 /src/frontend/mainindex/bookmarks/cbookmarkindex.h
parentdd2f7ce46df53f2c377c02d1bf4df8adcf092072 (diff)
Imported Upstream version 2.3.3
Diffstat (limited to 'src/frontend/mainindex/bookmarks/cbookmarkindex.h')
-rw-r--r--src/frontend/mainindex/bookmarks/cbookmarkindex.h194
1 files changed, 98 insertions, 96 deletions
diff --git a/src/frontend/mainindex/bookmarks/cbookmarkindex.h b/src/frontend/mainindex/bookmarks/cbookmarkindex.h
index 340fabc..748e75d 100644
--- a/src/frontend/mainindex/bookmarks/cbookmarkindex.h
+++ b/src/frontend/mainindex/bookmarks/cbookmarkindex.h
@@ -42,140 +42,142 @@ class QMouseEvent;
* @author The BibleTime team
*/
class CBookmarkIndex : public QTreeWidget {
- Q_OBJECT
+ Q_OBJECT
-public:
- CBookmarkIndex(QWidget *parent);
- virtual ~CBookmarkIndex();
+ public:
+ CBookmarkIndex(QWidget *parent);
+ virtual ~CBookmarkIndex();
- void initTree();
+ void initTree();
- /**
- * Saves the bookmarks to disk
- */
- void saveBookmarks();
+ /**
+ * Saves the bookmarks to disk
+ */
+ void saveBookmarks();
-signals:
- /**
- * Is emitted when a module should be opened,
- */
- void createReadDisplayWindow( QList<CSwordModuleInfo*>, const QString& );
+ signals:
+ /**
+ * Is emitted when a module should be opened,
+ */
+ void createReadDisplayWindow( QList<CSwordModuleInfo*>, const QString& );
-protected: // Protected methods
+ protected: // Protected methods
- /** A hack to get the modifiers. */
- virtual void mouseReleaseEvent(QMouseEvent* event);
+ /** A hack to get the modifiers. */
+ virtual void mouseReleaseEvent(QMouseEvent* event);
- /** Needed to paint an drag pointer arrow. */
- virtual void paintEvent(QPaintEvent* event);
+ /** Needed to paint an drag pointer arrow. */
+ virtual void paintEvent(QPaintEvent* event);
- /** Initialize the SIGNAL<->SLOT connections. */
- void initConnections();
+ /** Initialize the SIGNAL<->SLOT connections. */
+ void initConnections();
- /** Returns the drag object for the current selection. */
- virtual QMimeData* dragObject();
+ /** Returns the drag object for the current selection. */
+ virtual QMimeData* dragObject();
- /**
- * D'n'd methods are reimplementations from QTreeWidget or its ancestors.
- * In these we handle creating, moving and copying bookmarks with d'n'd.
- */
- virtual void dragEnterEvent( QDragEnterEvent* event );
- virtual void dragMoveEvent( QDragMoveEvent* event );
- virtual void dropEvent( QDropEvent* event );
- virtual void dragLeaveEvent( QDragLeaveEvent* event );
+ /**
+ * D'n'd methods are reimplementations from QTreeWidget or its ancestors.
+ * In these we handle creating, moving and copying bookmarks with d'n'd.
+ */
+ virtual void dragEnterEvent( QDragEnterEvent* event );
+ virtual void dragMoveEvent( QDragMoveEvent* event );
+ virtual void dropEvent( QDropEvent* event );
+ virtual void dragLeaveEvent( QDragLeaveEvent* event );
- /** Returns the correct action object for the given type of action. */
- QAction* action( BtBookmarkItemBase::MenuAction type ) const;
+ /** Returns the correct action object for the given type of action. */
+ QAction* action( BtBookmarkItemBase::MenuAction type ) const;
- /** Reimplementation from QAbstractItemView. Takes care of movable items. */
- virtual void startDrag(Qt::DropActions supportedActions);
+ /** Reimplementation from QAbstractItemView. Takes care of movable items. */
+ virtual void startDrag(Qt::DropActions supportedActions);
- /** Handle mouse moving (mag updates) */
- virtual void mouseMoveEvent(QMouseEvent* event);
+ /** Handle mouse moving (mag updates) */
+ virtual void mouseMoveEvent(QMouseEvent* event);
-protected slots:
+ protected slots:
- /** Prevents annoying folder collapsing while dropping. */
- void expandAutoCollapsedItem(QTreeWidgetItem* i) {expandItem(i);}
+ /** Prevents annoying folder collapsing while dropping. */
+ void expandAutoCollapsedItem(QTreeWidgetItem* i) {
+ expandItem(i);
+ }
- /** Is called when an item was clicked or activated. */
- void slotExecuted( QTreeWidgetItem* );
+ /** Is called when an item was clicked or activated. */
+ void slotExecuted( QTreeWidgetItem* );
- /** Shows the context menu at the given position. */
- void contextMenu(const QPoint&);
+ /** Shows the context menu at the given position. */
+ void contextMenu(const QPoint&);
- /** Adds a new subfolder to the current item. */
- void createNewFolder();
+ /** Adds a new subfolder to the current item. */
+ void createNewFolder();
- /** Opens a dialog to change the current folder. */
- void changeFolder();
+ /** Opens a dialog to change the current folder. */
+ void changeFolder();
- /** Exports the bookmarks from the selected folder. */
- void exportBookmarks();
+ /** Exports the bookmarks from the selected folder. */
+ void exportBookmarks();
- /** Changes the current bookmark. */
- void changeBookmark();
+ /** Changes the current bookmark. */
+ void changeBookmark();
- /** Helps with the extra item. */
- void slotItemEntered(QTreeWidgetItem*, int);
+ /** Helps with the extra item. */
+ void slotItemEntered(QTreeWidgetItem*, int);
- /** Import bookmarks from a file and add them to the selected folder. */
- void importBookmarks();
+ /** Import bookmarks from a file and add them to the selected folder. */
+ void importBookmarks();
- /** Deletes the selected entries. */
- void deleteEntries(bool confirm=true);
+ /** Deletes the selected entries. */
+ void deleteEntries(bool confirm = true);
- /** Prints the selected bookmarks. */
- void printBookmarks();
+ /** Prints the selected bookmarks. */
+ void printBookmarks();
- /** Slot for the mag update timer. */
- void magTimeout();
+ /** Slot for the mag update timer. */
+ void magTimeout();
-private:
+ private:
- /** Initializes the view. */
- void initView();
+ /** Initializes the view. */
+ void initView();
- /** Convenience function for creating a new action. */
- QAction* newQAction(const QString& text, const QString& pix, int shortcut, const QObject* receiver, const char* slot, QObject* parent);
+ /** Convenience function for creating a new action. */
+ QAction* newQAction(const QString& text, const QString& pix, int shortcut, const QObject* receiver, const char* slot, QObject* parent);
- /**
- * Returns true if more than one entry is supported by this action type.
- * Returns false for actions which support only one entry.
- */
- bool isMultiAction( const BtBookmarkItemBase::MenuAction type ) const;
+ /**
+ * Returns true if more than one entry is supported by this action type.
+ * Returns false for actions which support only one entry.
+ */
+ bool isMultiAction( const BtBookmarkItemBase::MenuAction type ) const;
- /** A helper function for d'n'd which creates a new bookmark item when drop happens. */
- void createBookmarkFromDrop(QDropEvent* event, QTreeWidgetItem* parentItem, int indexInParent);
+ /** A helper function for d'n'd which creates a new bookmark item when drop happens. */
+ void createBookmarkFromDrop(QDropEvent* event, QTreeWidgetItem* parentItem, int indexInParent);
- /**
- * Returns a list of new items created from the selection.
- * Sets flags which indicate whether the selection was legal for dropping.
- */
- QList<QTreeWidgetItem*> addItemsToDropTree(QTreeWidgetItem* target, bool& bookmarksOnly, bool& targetIncluded, bool& moreThanOneFolder);
+ /**
+ * Returns a list of new items created from the selection.
+ * Sets flags which indicate whether the selection was legal for dropping.
+ */
+ QList<QTreeWidgetItem*> addItemsToDropTree(QTreeWidgetItem* target, bool& bookmarksOnly, bool& targetIncluded, bool& moreThanOneFolder);
- struct Actions {
- QAction* newFolder;
- QAction* changeFolder;
+ struct Actions {
+ QAction* newFolder;
+ QAction* changeFolder;
- QAction* changeBookmark;
- QAction* importBookmarks;
- QAction* exportBookmarks;
- QAction* printBookmarks;
+ QAction* changeBookmark;
+ QAction* importBookmarks;
+ QAction* exportBookmarks;
+ QAction* printBookmarks;
- QAction* deleteEntries;
- }
- m_actions;
+ QAction* deleteEntries;
+ }
+ m_actions;
- QMenu* m_popup;
- QTimer m_magTimer;
- int m_mouseReleaseEventModifiers;
- QTreeWidgetItem* m_previousEventItem;
- QPoint m_dragMovementPosition;
- QPoint m_dragStartPosition;
- QTreeWidgetItem* m_extraItem;
+ QMenu* m_popup;
+ QTimer m_magTimer;
+ int m_mouseReleaseEventModifiers;
+ QTreeWidgetItem* m_previousEventItem;
+ QPoint m_dragMovementPosition;
+ QPoint m_dragStartPosition;
+ QTreeWidgetItem* m_extraItem;
};
#endif