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:Implements QT functionality to get message pdu details. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "msgcharcounter.h" |
|
19 #include "msgcharcounter_p.h" |
|
20 |
|
21 |
|
22 enum MsgCharSupport |
|
23 { |
|
24 msgCharSupportFull = 0, |
|
25 msgCharSupportReduced |
|
26 }; |
|
27 |
|
28 // --------------------------------------------------------------------------- |
|
29 // Default Constructor. |
|
30 // --------------------------------------------------------------------------- |
|
31 // |
|
32 MsgCharCounter::MsgCharCounter( QObject *parent ): |
|
33 QObject( parent ) |
|
34 { |
|
35 d_ptr = MsgCharCounterPrivate::newL( this ); |
|
36 } |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // Destructor |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 MsgCharCounter::~MsgCharCounter() |
|
43 { |
|
44 if (d_ptr) { |
|
45 delete d_ptr; |
|
46 d_ptr = NULL; |
|
47 } |
|
48 } |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // Sets the encoding settings. |
|
52 // --------------------------------------------------------------------------- |
|
53 // |
|
54 void MsgCharCounter::setEncodingSettings() |
|
55 { |
|
56 // Default values. |
|
57 bool unicodeMode = false; |
|
58 int alternativeEncodingType = 0; |
|
59 int charSupportType = msgCharSupportFull; |
|
60 |
|
61 d_ptr->setEncodingSettings(unicodeMode, alternativeEncodingType, |
|
62 charSupportType); |
|
63 } |
|
64 |
|
65 // --------------------------------------------------------------------------- |
|
66 // Gets the PDU details. |
|
67 // --------------------------------------------------------------------------- |
|
68 // |
|
69 void MsgCharCounter::getNumPDUs(const QString &buf, |
|
70 int &numOfRemainingChars, |
|
71 int &numOfPDUs, |
|
72 bool &unicodeMode, |
|
73 int &alternativeEncodingType) |
|
74 { |
|
75 d_ptr->getNumPDUs(buf, numOfRemainingChars, numOfPDUs, unicodeMode, |
|
76 alternativeEncodingType); |
|
77 } |
|
78 |
|
79 // EOF |
|