homescreensrv_plat/contentstorage_api/inc/caentry.h
changeset 125 26079c1bb561
child 127 7b66bc3c6dc9
equal deleted inserted replaced
123:d1dadafc5584 125:26079c1bb561
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     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  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: caentry.h
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CAENTRY_H
       
    19 #define CAENTRY_H
       
    20 
       
    21 #include <QMap>
       
    22 #include <QSharedDataPointer>
       
    23 #include <QSize>
       
    24 
       
    25 #include "caclient_global.h"
       
    26 #include "cadefs.h"
       
    27 #include "caicondescription.h"
       
    28 
       
    29 CA_CLIENT_TEST_CLASS( TestCaClient )
       
    30 
       
    31 class CaObjectAdapter;
       
    32 class CaEntryPrivate;
       
    33 class HbIcon;
       
    34 
       
    35 class CACLIENT_EXPORT CaEntry
       
    36 {
       
    37     /*!
       
    38      * This class is not intended to be derived.
       
    39      */
       
    40 
       
    41 public:
       
    42 
       
    43     explicit CaEntry(EntryRole entryRole = ItemEntryRole);
       
    44 
       
    45     virtual ~CaEntry();
       
    46 
       
    47     int id() const;
       
    48 
       
    49     QString text() const;
       
    50     void setText(const QString &text, bool localized = false);
       
    51 
       
    52     QString description() const;
       
    53     void setDescription(const QString &text, bool localized = false);
       
    54     
       
    55     CaIconDescription iconDescription() const;
       
    56     void setIconDescription(const CaIconDescription &iconDescription);
       
    57 
       
    58     EntryFlags flags() const;
       
    59     void setFlags(EntryFlags flags);
       
    60 
       
    61     QString entryTypeName() const;
       
    62     void setEntryTypeName(const QString &entryTypeName);
       
    63 
       
    64     QMap<QString, QString> attributes() const;
       
    65     QString attribute(const QString &name) const;
       
    66     void setAttribute(const QString &name, const QString &value);
       
    67     void removeAttribute(const QString &name);
       
    68 
       
    69     HbIcon makeIcon(const QSizeF &size = QSizeF(70.0, 70.0)) const;
       
    70 
       
    71     EntryRole role() const;
       
    72 
       
    73     CaEntry(const CaEntry &entry);
       
    74     CaEntry &operator=(const CaEntry &entry);
       
    75 
       
    76 private:
       
    77 
       
    78     void setId(int id);
       
    79     bool isLocalized(LocalizationType localized) const; 
       
    80 
       
    81 private:
       
    82     /*!
       
    83      * A special kind of pointer, supporting sharing data, to a private
       
    84      * implementation.
       
    85      */
       
    86     QSharedDataPointer<CaEntryPrivate> m_d;
       
    87 
       
    88     friend class CaEntryPrivate;
       
    89     friend class ::CaObjectAdapter;
       
    90 
       
    91     CA_CLIENT_TEST_FRIEND_CLASS( TestCaClient )
       
    92 
       
    93 };
       
    94 
       
    95 
       
    96 #endif // CAENTRY_H