add a couple of methods here so matt knows where to put the loading code

svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=492459
This commit is contained in:
Aaron J. Seigo 2005-12-30 00:25:15 +00:00
parent 468bc137a9
commit 148d563a44
2 changed files with 42 additions and 2 deletions

View File

@ -28,13 +28,15 @@ class AppletChain::Private
Private()
: popupDirection(Up),
constraint(Plasma::NoConstraint),
screenEdge(BottomEdge)
screenEdge(BottomEdge),
screen(0)
{
}
Direction popupDirection;
AppletConstraint constraint;
int screen;
ScreenEdge screenEdge;
Applet::List applets;
@ -74,6 +76,32 @@ void AppletChain::setConstraint(Plasma::AppletConstraint constraint)
}
}
void AppletChain::setXineramaScreen(int screen)
{
if (screen < 0 || screen > qApp->desktop()->numScreens() - 1)
{
kdDebug() << "tried to set a bad screen for AppletChain" << endl;
return;
}
d->screen = screen;
}
void loadApplet(KService::Ptr)
{
//TODO: load the buggers from a KService pointer!
}
void addApplet(Plasma::Applet* applet)
{
d->applets.append(applet);
}
int AppletChain::xineramaScreen()
{
return d->screen;
}
void AppletChain::setScreenEdge(Plasma::ScreenEdge edge)
{
d->screenEdge = edge;

View File

@ -30,6 +30,8 @@ class KDE_EXPORT AppletChain : public QObject, public KShared
{
Q_OBJECT
Q_PROPERTY(AppletConstraint constraint READ constraint WRITE setConstraint)
Q_PROPERTY(ScreenEdge screenEdge READ screenEdge WRITE setScreenEdge)
Q_PROPERTY(int XineramaScreen READ screenEdge WRITE setXineramaScreen)
public:
typedef KSharedPtr<AppletChain> Ptr;
@ -41,9 +43,19 @@ class KDE_EXPORT AppletChain : public QObject, public KShared
void setConstraint(Plasma::AppletConstraint constraint);
Plasma::Direction popupDirection() const;
void setScreenEdge(Plasma::ScreenEdge edge);
Plasma::ScreenEdge screenEdge();
void setScreenEdge(Plasma::ScreenEdge edge);
int xineramaScreen();
void setXineramaScreen(int screen);
public slots:
void loadApplet(KService::Ptr);
void addApplet(Applet*);
signals:
void appletAdded(Applet*);
void appletRemoved(Applet*);
private:
class Private;