homescreensrv_plat/contentstorage_api/cadefs.h
changeset 125 26079c1bb561
parent 123 d1dadafc5584
child 126 efda7c0771b9
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: cadefs.h
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CADEFS_H
       
    19 #define CADEFS_H
       
    20 
       
    21 #include <QFlags>
       
    22 #include <QMetaType>
       
    23 
       
    24 enum ChangeType
       
    25 {
       
    26     AddChangeType,
       
    27     RemoveChangeType,
       
    28     UpdateChangeType
       
    29 };
       
    30 
       
    31 enum EntryRole
       
    32 {
       
    33     ItemEntryRole = 1,
       
    34     GroupEntryRole = 2
       
    35 };
       
    36 Q_DECLARE_FLAGS(EntryRoles, EntryRole)
       
    37 Q_DECLARE_OPERATORS_FOR_FLAGS(EntryRoles)
       
    38 
       
    39 enum SortAttribute
       
    40 {
       
    41     NameSortAttribute,
       
    42     CreatedTimestampSortAttribute,
       
    43     MostUsedSortAttribute,
       
    44     LastUsedSortAttribute,
       
    45     DefaultSortAttribute
       
    46 // default - return items in custom order
       
    47 };
       
    48 
       
    49 enum EntryFlag
       
    50 {
       
    51     UsedEntryFlag = 1,
       
    52     UninstallEntryFlag = 2,
       
    53     RemovableEntryFlag = 4,
       
    54     VisibleEntryFlag = 8,
       
    55     ReservedEntryFlag = 16, //flag is unused, stays for compatibility
       
    56     NativeEntryFlag = 32,
       
    57     MissingEntryFlag = 64
       
    58 };
       
    59 
       
    60 enum LocalizationType
       
    61 {
       
    62     NameLocalized,
       
    63     DescriptionLocalized
       
    64 };
       
    65 
       
    66 Q_DECLARE_FLAGS(EntryFlags, EntryFlag)
       
    67 Q_DECLARE_OPERATORS_FOR_FLAGS(EntryFlags)
       
    68 Q_DECLARE_METATYPE(EntryFlags)
       
    69 
       
    70 enum ErrorCode
       
    71 {
       
    72     NoErrorCode = 0,
       
    73     NotFoundErrorCode,
       
    74     OutOfMemoryErrorCode,
       
    75     BadArgumentErrorCode,
       
    76     ServerTerminated,
       
    77     UnknownErrorCode
       
    78 };
       
    79 
       
    80 const char caCmdOpen[] = "open";
       
    81 const char caCmdRemove[] = "remove";
       
    82 
       
    83 #ifndef QT_NO_DEBUG_OUTPUT
       
    84 #   define USE_QDEBUG_IF(predicate) if (!predicate) {} else qDebug()
       
    85 #else
       
    86 #   define USE_QDEBUG_IF(predicate) if (1) {} else qDebug()
       
    87 #endif
       
    88 
       
    89 #ifndef QT_NO_WARNING_OUTPUT
       
    90 #   define USE_QWARNING_IF(predicate) if (!predicate) {} else qWarning()
       
    91 #else
       
    92 #   define USE_QWARNING_IF(predicate) if (1) {} else qWarning()
       
    93 #endif
       
    94 
       
    95 #endif // CADEFS_H