screensavermodel/inc/iscreensaverprovider.h
author hgs
Tue, 23 Mar 2010 23:55:55 +0200
changeset 88 7f0462e8c3da
parent 85 7feec50967db
permissions -rw-r--r--
201009
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
85
7feec50967db 201003_02
hgs
parents:
diff changeset
     1
/*
7feec50967db 201003_02
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
7feec50967db 201003_02
hgs
parents:
diff changeset
     3
* All rights reserved.
7feec50967db 201003_02
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7feec50967db 201003_02
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7feec50967db 201003_02
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
7feec50967db 201003_02
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
7feec50967db 201003_02
hgs
parents:
diff changeset
     8
*
7feec50967db 201003_02
hgs
parents:
diff changeset
     9
* Initial Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7feec50967db 201003_02
hgs
parents:
diff changeset
    11
*
7feec50967db 201003_02
hgs
parents:
diff changeset
    12
* Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    13
* 
7feec50967db 201003_02
hgs
parents:
diff changeset
    14
* Description:  Screensaver provider interface.
7feec50967db 201003_02
hgs
parents:
diff changeset
    15
*
7feec50967db 201003_02
hgs
parents:
diff changeset
    16
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    17
7feec50967db 201003_02
hgs
parents:
diff changeset
    18
#ifndef ISCREENSAVERPROVIDER_H
7feec50967db 201003_02
hgs
parents:
diff changeset
    19
#define ISCREENSAVERPROVIDER_H
7feec50967db 201003_02
hgs
parents:
diff changeset
    20
7feec50967db 201003_02
hgs
parents:
diff changeset
    21
#include <QtPlugin>
7feec50967db 201003_02
hgs
parents:
diff changeset
    22
#include <QVariant>
7feec50967db 201003_02
hgs
parents:
diff changeset
    23
7feec50967db 201003_02
hgs
parents:
diff changeset
    24
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    25
    \class ScreensaverToken
7feec50967db 201003_02
hgs
parents:
diff changeset
    26
    \brief Represents a screensaver that can be created.
7feec50967db 201003_02
hgs
parents:
diff changeset
    27
7feec50967db 201003_02
hgs
parents:
diff changeset
    28
    Screensavers are located in screensaver providers. Each provider
7feec50967db 201003_02
hgs
parents:
diff changeset
    29
    exposes its contained screensavers as screensaver tokens. A token has
7feec50967db 201003_02
hgs
parents:
diff changeset
    30
    all the needed information for screensaver selection and creation.
7feec50967db 201003_02
hgs
parents:
diff changeset
    31
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    32
class ScreensaverToken
7feec50967db 201003_02
hgs
parents:
diff changeset
    33
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    34
7feec50967db 201003_02
hgs
parents:
diff changeset
    35
public:
7feec50967db 201003_02
hgs
parents:
diff changeset
    36
7feec50967db 201003_02
hgs
parents:
diff changeset
    37
    /*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    38
        The name of the library/plugin that contains the screensaver.
7feec50967db 201003_02
hgs
parents:
diff changeset
    39
    */
7feec50967db 201003_02
hgs
parents:
diff changeset
    40
    QString mLibrary;
7feec50967db 201003_02
hgs
parents:
diff changeset
    41
7feec50967db 201003_02
hgs
parents:
diff changeset
    42
    /*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    43
        Uniquely identifies the screensaver.
7feec50967db 201003_02
hgs
parents:
diff changeset
    44
    */
7feec50967db 201003_02
hgs
parents:
diff changeset
    45
    QString mUri;
7feec50967db 201003_02
hgs
parents:
diff changeset
    46
7feec50967db 201003_02
hgs
parents:
diff changeset
    47
};
7feec50967db 201003_02
hgs
parents:
diff changeset
    48
7feec50967db 201003_02
hgs
parents:
diff changeset
    49
class Screensaver;
7feec50967db 201003_02
hgs
parents:
diff changeset
    50
7feec50967db 201003_02
hgs
parents:
diff changeset
    51
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    52
    \class IScreensaverProvider
7feec50967db 201003_02
hgs
parents:
diff changeset
    53
    \brief Defines a mechanism for retrieving a screensaver.
7feec50967db 201003_02
hgs
parents:
diff changeset
    54
7feec50967db 201003_02
hgs
parents:
diff changeset
    55
    Interface that defines a mechanism for retrieving a screensaver.
7feec50967db 201003_02
hgs
parents:
diff changeset
    56
    Each screensaver provider implements this interface. 
7feec50967db 201003_02
hgs
parents:
diff changeset
    57
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    58
class IScreensaverProvider
7feec50967db 201003_02
hgs
parents:
diff changeset
    59
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    60
7feec50967db 201003_02
hgs
parents:
diff changeset
    61
public:
7feec50967db 201003_02
hgs
parents:
diff changeset
    62
7feec50967db 201003_02
hgs
parents:
diff changeset
    63
    /*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    64
        Destructs the class.
7feec50967db 201003_02
hgs
parents:
diff changeset
    65
    */
7feec50967db 201003_02
hgs
parents:
diff changeset
    66
    virtual ~IScreensaverProvider() {}
7feec50967db 201003_02
hgs
parents:
diff changeset
    67
7feec50967db 201003_02
hgs
parents:
diff changeset
    68
public:
7feec50967db 201003_02
hgs
parents:
diff changeset
    69
7feec50967db 201003_02
hgs
parents:
diff changeset
    70
    /*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    71
        Returns contained screensavers as a list of screensaver tokens.
7feec50967db 201003_02
hgs
parents:
diff changeset
    72
        \return Contained screensavers as tokens.
7feec50967db 201003_02
hgs
parents:
diff changeset
    73
    */
7feec50967db 201003_02
hgs
parents:
diff changeset
    74
    virtual QList<ScreensaverToken> screensavers() = 0;
7feec50967db 201003_02
hgs
parents:
diff changeset
    75
7feec50967db 201003_02
hgs
parents:
diff changeset
    76
    /*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    77
        Creates and returns a screensaver based on the given token.
7feec50967db 201003_02
hgs
parents:
diff changeset
    78
        \param token Identifies the screensaver to be created.
7feec50967db 201003_02
hgs
parents:
diff changeset
    79
        \return The created screensaver or null in failure cases.
7feec50967db 201003_02
hgs
parents:
diff changeset
    80
    */
7feec50967db 201003_02
hgs
parents:
diff changeset
    81
    virtual Screensaver *createScreensaver(const ScreensaverToken &token) = 0;
7feec50967db 201003_02
hgs
parents:
diff changeset
    82
7feec50967db 201003_02
hgs
parents:
diff changeset
    83
};
7feec50967db 201003_02
hgs
parents:
diff changeset
    84
7feec50967db 201003_02
hgs
parents:
diff changeset
    85
Q_DECLARE_METATYPE(ScreensaverToken)
7feec50967db 201003_02
hgs
parents:
diff changeset
    86
Q_DECLARE_INTERFACE(IScreensaverProvider,
7feec50967db 201003_02
hgs
parents:
diff changeset
    87
    "com.nokia.screensaver.iscreensaverprovider/1.0")
7feec50967db 201003_02
hgs
parents:
diff changeset
    88
7feec50967db 201003_02
hgs
parents:
diff changeset
    89
#endif // ISCREENSAVERPROVIDER_H