|
1 /* |
|
2 * Copyright (c) 2006-2006 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: General methods for message handling |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAMESSAGEUTIL_H |
|
20 #define CAMESSAGEUTIL_H |
|
21 |
|
22 // FORWARD DECLARATIONS |
|
23 class TTime; |
|
24 class MCAMessage; |
|
25 class MCAMessageCreator; |
|
26 class MCAMessagesWriteInterface; |
|
27 class MCASettings; |
|
28 |
|
29 /** |
|
30 * General message handling methods. |
|
31 * |
|
32 * General message handling methods which are to be used in both |
|
33 * messagehandler and chatgroupmanager, to avoid duplicate code. |
|
34 * |
|
35 * @lib CAEngine.dll |
|
36 * @since S60 v3.1 |
|
37 */ |
|
38 class CAMessageUtil // CSI: 51 # This is not a C-class although it begins with CA |
|
39 { |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Appends a datestamp to writeinterface if needed. |
|
44 * New time is compared to the previous message in the interface. |
|
45 * If the time values are from different date then datestamp is created |
|
46 * Otherwise this does nothing. |
|
47 * |
|
48 * @since S60 v3.1 |
|
49 * @param aNewTime Time of the new message |
|
50 * @param aWriteInterface Interface to write the date message |
|
51 * @param aMessageCreator for creating the date message |
|
52 * @param aSettingsAPI Settings interface to determine if datestamps |
|
53 * are required. |
|
54 */ |
|
55 static void AppendDateStampL( TTime aNewTime, |
|
56 MCAMessagesWriteInterface& aWriteInterface, |
|
57 MCAMessageCreator& aMessageCreator ); |
|
58 |
|
59 |
|
60 /** |
|
61 * Appends a datestamp and message to interface. Datestamp is added only |
|
62 * if the date has changed between previous and current message. |
|
63 * Ownership of the message is transferred or shared, so it doesn't |
|
64 * need to be in cleanupstack. |
|
65 * |
|
66 * @since S60 v3.1 |
|
67 * @param aNewMessage New message |
|
68 * @param aWriteInterface Interface to write the date message |
|
69 * @param aMessageCreator for creating the date message |
|
70 * @param aSettingsAPI Settings interface to determine if datestamps |
|
71 * are required. |
|
72 * @param aSharedOwnership EFalse - ownership is transferred |
|
73 * ETrue - ownership is shared |
|
74 */ |
|
75 static void AppendMessageWithDateStampL( |
|
76 MCAMessage& aNewMessage, |
|
77 MCAMessagesWriteInterface& aWriteInterface, |
|
78 MCAMessageCreator& aMessageCreator, |
|
79 TBool aSharedOwnership = EFalse ); |
|
80 |
|
81 private: |
|
82 |
|
83 /** |
|
84 * C++ constructor & destructor |
|
85 */ |
|
86 CAMessageUtil(); |
|
87 ~CAMessageUtil(); |
|
88 }; |
|
89 |
|
90 |
|
91 #endif // CAMESSAGEUTIL_H |