ginebra2/Snippets.h
changeset 3 0954f5dd2cd0
parent 0 1450b09d0cfd
equal deleted inserted replaced
1:b0dd75e285d2 3:0954f5dd2cd0
     1 /*
     1 /*
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
     4 *
     9 * Initial Contributors:
     5 * This program is free software: you can redistribute it and/or modify
    10 * Nokia Corporation - initial contribution.
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
    11 *
     8 *
    12 * Contributors:
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
    13 *
    13 *
    14 * Description: 
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not,
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:
    15 *
    19 *
    16 */
    20 */
    17 
       
    18 #ifndef __gva_snippets_h__
    21 #ifndef __gva_snippets_h__
    19 #define __gva_snippets_h__
    22 #define __gva_snippets_h__
    20 
    23 
    21 #include <QObject>
    24 #include <QObject>
    22 #include <QMap>
    25 #include <QMap>
    25 namespace GVA{
    28 namespace GVA{
    26 
    29 
    27   class ChromeSnippet;
    30   class ChromeSnippet;
    28   class ChromeWidget;
    31   class ChromeWidget;
    29 
    32 
       
    33   /*! \ingroup JavascriptAPI
       
    34    * \brief This class maintains the list of all ChromeSnippets.
       
    35    *
       
    36    * Javascript object name: "snippets".
       
    37    *
       
    38    * Example javascript code to toggle the visibility of the snippet defined ablove:
       
    39    * \code
       
    40    * snippets.StatusBarChromeId.toggleVisibility();
       
    41    * \endcode
       
    42    * \sa ChromeSnippet
       
    43    */
    30   class Snippets : public QObject
    44   class Snippets : public QObject
    31   {
    45   {
    32   public:
    46   public:
    33     Snippets(ChromeWidget * chrome, QObject * parent);
    47     Snippets(ChromeWidget * chrome, QObject * parent);
    34     virtual ~Snippets();
    48     virtual ~Snippets();
    35     ChromeSnippet * getSnippet(const QString & id);
    49     ChromeSnippet * getSnippet(const QString & id);
    36     void addSnippet(ChromeSnippet *, const QString & id);
    50     void addSnippet(ChromeSnippet *, const QString & id);
    37     QObjectList getList(); 
    51     QObjectList getList();
    38     void clear();
    52     void clear();
    39     void dump();
    53     void dump();
    40   private:
    54   private:
    41     QMap<QString, ChromeSnippet *> m_snippetMap;
    55     QMap<QString, ChromeSnippet *> m_snippetMap;
    42     ChromeWidget * m_chrome;
    56     ChromeWidget * m_chrome;