summaryrefslogtreecommitdiffstats
path: root/adept/libadept/groupeddesktopselector.h
blob: 7e3c8b081b671e3ad66eb64f93d7d63a428e7d2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/** -*- C++ -*-
    @file adept/groupeddestkopselector.h
    @author Peter Rockai <me@mornfall.net>
*/

#include <kjanuswidget.h>
#include <apt-front/cache/entity/desktop.h>

namespace adept {
using namespace aptFront;
using namespace aptFront::cache;

// XXX needs fixing
class GroupedDesktopSelector : public KJanusWidget, cache::Observer
{
    Q_OBJECT
  
public:
    struct IconPolicy {
        virtual TQString iconForGroup( TQString group ) { return group; }
    };
    GroupedDesktopSelector( TQWidget *p = 0, const char *n = 0 );
    void fill( component::Desktop::EntityRange r );
    void setPolicy( IconPolicy *p ) { m_policy = p; }
    IconPolicy *policy() { return m_policy; }
    virtual void notifyPreRebuild( cache::component::Base * );
    virtual void notifyPostRebuild( cache::component::Base * );
public slots:
    void clear();
    void fill();
signals:
    void request( cache::entity::Package, cache::component::State::Action );
    void showDescription( cache::entity::Desktop );
protected:
    IconPolicy *m_policy;
    std::vector< TQWidget * > m_pages;
    // IconPolicy m_defaultPolicy;
};

}