cbs/CbsServer/ClientInc/CbsCommon.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2003 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:  This file contains The only common header file between CBS UI and 
       
    15 *                CbsClient packages.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CBSCOMMON_H
       
    22 #define CBSCOMMON_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <s32std.h>
       
    27 #include <CbsCommonTypes.h>
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // Max count of topic lists in the root
       
    32 const TInt KCbsRootItemsSize = 1;
       
    33 
       
    34 // DATA TYPES  
       
    35 
       
    36 /**
       
    37 *   Type for representing handles to the topics.
       
    38 *
       
    39 *   For each topic there is an unique handle that does not change. 
       
    40 *   When the topic is deleted, the same handle can be used again.
       
    41 */
       
    42 typedef TUint16 TCbsDbTopicHandle;
       
    43 
       
    44 // A handle to a topic.
       
    45 typedef TCbsDbTopicHandle TCbsTopicHandle;
       
    46 
       
    47 // A topic name.
       
    48 typedef TCbsDbTopicName TCbsTopicName;
       
    49 
       
    50 /**
       
    51 *   The structure that represents information about single topic. 
       
    52 *
       
    53 *   When an index message is received, then a new topic collection is created.
       
    54 *   In deed, records of this type are created.
       
    55 */
       
    56 struct TCbsDbTopicIdentity
       
    57     {
       
    58     // Name of the topic
       
    59     TCbsDbTopicName iName;
       
    60 
       
    61     // The topic number (that is, the message identifier)
       
    62     TCbsDbTopicNumber iNumber;
       
    63     };
       
    64 
       
    65 // Type returned by RCbs::GetNextAndPrevTopicNumber and 
       
    66 // RCbs::GetNextAndPrevMessageHandle to specify whether the item in question 
       
    67 // is the first or the last (or both) in list.
       
    68 enum TCbsPositionInList 
       
    69     {
       
    70     ECbsHead = 0x01,
       
    71     ECbsTail = 0x02
       
    72     };
       
    73 
       
    74 // Enumerates the different language settings.
       
    75 enum TCbsDbLanguage
       
    76     {
       
    77     ECbsGerman,                 // German             
       
    78     ECbsEnglish,                // English      
       
    79     ECbsItalian,                // Italian      
       
    80     ECbsFrench,                 // French       
       
    81     ECbsSpanish,                // Spanish      
       
    82     ECbsDutch,                  // Dutch        
       
    83     ECbsSwedish,                // Swedish      
       
    84     ECbsDanish,                 // Danish       
       
    85     ECbsPortuguese,             // Portuguese   
       
    86     ECbsFinnish,                // Finnish      
       
    87     ECbsNorwegian,              // Norwegian    
       
    88     ECbsGreek,                  // Greek        
       
    89     ECbsTurkish,                // Turkish      
       
    90     ECbsHungarian,              // Hungarian
       
    91     ECbsPolish,                 // Polish
       
    92     ECbsCzech,                  // Czech
       
    93     ECbsHebrew,                 // Hebrew
       
    94     ECbsArabic,                 // Arabic
       
    95     ECbsRussian,                // Russian
       
    96     ECbsIcelandic,              // Icelandic
       
    97     ECbsOther,                  // Other 
       
    98     ECbsAll,                    // All
       
    99     ECbsCount                   // The amount of languages, 
       
   100                                 // this must be the last element
       
   101     };
       
   102 
       
   103 
       
   104 // Structure to contain user-selected languages
       
   105 struct TCbsDbLanguages
       
   106     {
       
   107     TBool iLanguages[ ECbsCount ];
       
   108     };
       
   109 
       
   110 // Structure containing cached information on topic
       
   111 struct TCbsDbImpTopic
       
   112     {
       
   113     // The stream identifier to the topic information.
       
   114     TStreamId iTopicId;
       
   115 
       
   116     // The stream identifier to the messages of the topic.
       
   117     TStreamId iTopicMessagesId;
       
   118 
       
   119     // The rest of the topic information
       
   120     TCbsDbTopic iTopicData;
       
   121     };
       
   122 
       
   123 // Structure that contains information about a topic list
       
   124 struct TCbsDbTopicList
       
   125     {    
       
   126     // Name of the topic list
       
   127     TBuf< KCbsDbTopicNameLength > iTopicListName;
       
   128 
       
   129     // Is this topic list the default topic list
       
   130     TBool iIsDefaultTopicList;
       
   131     
       
   132     // The integer identifier of the list
       
   133     TInt iNumber;
       
   134 
       
   135     // NUmber of topic lists in this list
       
   136     TInt iTopicCount;
       
   137     };
       
   138 
       
   139 
       
   140 // The structure that contains (root) stream information.
       
   141 struct TCbsDbImpTopicList
       
   142     {    
       
   143     // Name of the topic list
       
   144     TBuf< KCbsDbTopicNameLength > iTopicListName;    
       
   145 
       
   146     // Is this topic list the default topic list
       
   147     TBool iIsDefaultTopicList;
       
   148 
       
   149     // The integer identifier of the list
       
   150     TInt iNumber;
       
   151 
       
   152     // NUmber of topic lists in this list
       
   153     TInt iTopicCount;
       
   154         
       
   155 	// The ID to topic list stream of this topic list
       
   156 	TStreamId iTopicListId;
       
   157     };
       
   158 
       
   159 // Enumerates the reasons for the client panic.
       
   160 enum TCbsSessionPanic
       
   161     {
       
   162     ECbsBadRequest,
       
   163     ECbsBadDescriptor
       
   164     };
       
   165 
       
   166 // Enumerates the different types of settings-session related events.
       
   167 enum TCbsSettingsEvent
       
   168     {
       
   169     ECbsModifiedReceptionStatus,        // Reception status was modified
       
   170     ECbsModifiedTopicDetectionStatus,   // Topic detection status was modified
       
   171     ECbsModifiedLanguages,              // Preferred languages were modified
       
   172     ECbsModifiedLimitedReceptionStatus, // Time-limited reception status modified
       
   173     ECbsModifiedCleanupTime             // Clean up time of read messages modified
       
   174     };
       
   175 
       
   176 // Enumerates the different types of topic list events that can occur.
       
   177 enum TCbsTopicListEvent
       
   178     {
       
   179     ECbsTopicListInitialized = 0x01,
       
   180     ECbsTopicAdded = 0x02,
       
   181     ECbsTopicModified = 0x04,
       
   182     ECbsTopicDeleted = 0x08,
       
   183     ECbsTopicReceivedNewMessage = 0x10,
       
   184     ECbsTopicAllEvents = ( 0x01 | 0x02 | 0x04 | 0x08 | 0x10 )
       
   185     };
       
   186 
       
   187 // Structure to contain user-selected languages
       
   188 typedef TCbsDbLanguages TCbsSettingsLanguages;
       
   189 
       
   190 // A structure that contains information about a topic list
       
   191 typedef TCbsDbTopicList TCbsTopicList;
       
   192 
       
   193 // A structure that contains information about one topic (information
       
   194 // that is retrieved from the index topic).
       
   195 typedef TCbsDbTopicIdentity TCbsTopicInfo;
       
   196 
       
   197 #endif      // CBSCOMMON_H   
       
   198             
       
   199 // End of File
       
   200