|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __AGMIDS_H__ |
|
17 #define __AGMIDS_H__ |
|
18 |
|
19 #include "agmcalendartime.h" |
|
20 |
|
21 #include <s32std.h> |
|
22 |
|
23 class RReadStream; |
|
24 class RWriteStream; |
|
25 class TAgnInstanceId; |
|
26 |
|
27 NONSHARABLE_CLASS(TAgnEntryId) |
|
28 /** The base class for agenda entry and instance ID types. |
|
29 Internally, the ID is stored as a 32-bit unsigned integer. |
|
30 |
|
31 This is made up of a stream ID which stores the stream containing the entry, and a partial ID, |
|
32 which gives the position of the entry within that stream. There can be up to EMaxNumEntriesPerStream |
|
33 entries in a stream (16). |
|
34 |
|
35 @internalAll |
|
36 @released |
|
37 */ |
|
38 { |
|
39 public: |
|
40 enum {EMaxNumEntriesPerStream = 16}; |
|
41 |
|
42 IMPORT_C TAgnEntryId(); |
|
43 IMPORT_C TAgnEntryId(const TStreamId& aStreamId,TUint aPartialId); |
|
44 IMPORT_C TBool operator==(const TAgnEntryId& aId) const; |
|
45 IMPORT_C TBool operator!=(const TAgnEntryId& aId) const; |
|
46 inline TStreamId StreamId() const; |
|
47 void SetStreamId(const TStreamId& aId); |
|
48 IMPORT_C TUint PartialId() const; |
|
49 inline TUint Value() const; |
|
50 IMPORT_C TBool IsNullId() const; |
|
51 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
52 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
|
53 private: |
|
54 void SetPartialId(TUint aId); |
|
55 protected: |
|
56 TUint32 iId; |
|
57 }; |
|
58 |
|
59 NONSHARABLE_CLASS(TAgnInstanceId) : public TAgnEntryId |
|
60 /** Identifies an instance of an entry in the agenda instance model (CAgnModel), |
|
61 using an entry ID (TAgnEntryId) and an agenda date (TTime). |
|
62 @internalAll |
|
63 @released |
|
64 */ |
|
65 { |
|
66 public: |
|
67 IMPORT_C TBool operator==(const TAgnInstanceId& aId) const; |
|
68 IMPORT_C TBool operator!=(const TAgnInstanceId& aId) const; |
|
69 IMPORT_C const TAgnCalendarTime& Date() const; |
|
70 IMPORT_C void SetDate(const TAgnCalendarTime& aDate); |
|
71 IMPORT_C void SetEntryId(const TAgnEntryId& aId); |
|
72 |
|
73 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
74 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
|
75 |
|
76 protected: |
|
77 TAgnCalendarTime iDate; |
|
78 }; |
|
79 |
|
80 class TAgnInstance |
|
81 { |
|
82 public: |
|
83 IMPORT_C void InternalizeL(RReadStream& aReadStream); |
|
84 IMPORT_C void ExternalizeL(RWriteStream& aWriteStream) const; |
|
85 |
|
86 public: |
|
87 TAgnInstanceId iId; |
|
88 TUint8 iCollectionId; |
|
89 }; |
|
90 #include "agmids.inl" |
|
91 |
|
92 #endif |