Handle nested TOC items.
[dorian] / widgets / listwindow.h
index 7b7d585..c9c958e 100644 (file)
@@ -7,11 +7,13 @@
 
 class QListView;
 class QString;
-class QHBoxLayout;
+class QBoxLayout;
 class QPushButton;
 class QModelIndex;
 class QItemSelection;
 class QEvent;
+class ListView;
+class FlickCharm;
 
 /** A window with a list and menu actions (Maemo) or buttons (non-Maemo). */
 class ListWindow: public QMainWindow
@@ -22,7 +24,7 @@ public:
     explicit ListWindow(QWidget *parent = 0);
 
     /** Add a list view to the window. */
-    void addList(QListView *list);
+    void addList(ListView *list);
 
     /**
      * Add an action to the window: either a button, or, on Maemo, a top
@@ -30,6 +32,7 @@ public:
      * Activating the action invokes the slot with no parameters.
      */
     void addAction(const QString &title, QObject *receiver, const char *slot,
+        const QString &iconPath = QString(),
         QDialogButtonBox::ButtonRole role = QDialogButtonBox::ActionRole);
 
     /**
@@ -41,10 +44,17 @@ public:
     void addItemAction(const QString &title, QObject *receiver,
                        const char *slot);
 
+public slots:
+#ifdef Q_OS_SYMBIAN
+    void show();
+#endif
+
 protected slots:
     void onSelectionChanged(const QItemSelection &selected,
                             const QItemSelection &deselected);
-#ifndef Q_WS_MAEMO_5
+#ifdef Q_WS_MAEMO_5
+    void onModelChanged();
+#else
     void activateItemButtons();
 #endif
 
@@ -56,9 +66,12 @@ protected:
 #else
     QDialogButtonBox *buttonBox;
     QList<QPushButton *> itemButtons;
+#endif // Q_WS_MAEMO_5
+#ifdef Q_OS_SYMBIAN
+    FlickCharm *charm;
 #endif
-    QHBoxLayout *frameLayout;
-    QListView *list;
+    QBoxLayout *contentLayout;
+    ListView *list;
 };
 
 #endif // LISTWINDOW_H