13
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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:
|
|
15 |
*
|
|
16 |
*/
|
24
|
17 |
#include <QRegExp>
|
13
|
18 |
#include <cpixdocumentfield.h>
|
|
19 |
#include "cpixdocumentfieldprivate.h"
|
|
20 |
|
24
|
21 |
#define SEPERATOR_EXP "\\s+"
|
13
|
22 |
/**
|
|
23 |
* Note: Code in this file should never throw OR leak symbian exceptions.
|
|
24 |
* Convert all leaves to C++ exceptions.
|
|
25 |
*/
|
|
26 |
|
|
27 |
CpixDocumentField::CpixDocumentField( const QString aName, const QString aValue, const int aConfig )
|
|
28 |
:iPvtImpl( new CpixDocumentFieldPrivate(aName,aValue,aConfig) )
|
|
29 |
{
|
|
30 |
}
|
|
31 |
|
|
32 |
CpixDocumentField* CpixDocumentField::newInstance( const QString aName, const QString aValue, const int aConfig )
|
|
33 |
{
|
|
34 |
CpixDocumentField* field = NULL;
|
|
35 |
try{
|
|
36 |
field = new CpixDocumentField( aName, aValue, aConfig );
|
|
37 |
}
|
|
38 |
catch(...){
|
|
39 |
delete field;
|
|
40 |
return NULL;
|
|
41 |
}
|
|
42 |
return field;
|
|
43 |
}
|
|
44 |
|
|
45 |
CpixDocumentField::~CpixDocumentField()
|
|
46 |
{
|
|
47 |
delete iPvtImpl;
|
|
48 |
}
|
|
49 |
|
|
50 |
QString CpixDocumentField::name() const
|
|
51 |
{
|
|
52 |
return iPvtImpl->iName;
|
|
53 |
}
|
|
54 |
|
|
55 |
QString CpixDocumentField::value() const
|
|
56 |
{
|
|
57 |
return iPvtImpl->iValue;
|
|
58 |
}
|
|
59 |
|
|
60 |
int CpixDocumentField::config() const
|
|
61 |
{
|
|
62 |
return iPvtImpl->iConfig;
|
|
63 |
}
|
|
64 |
|
|
65 |
void CpixDocumentField::setName(const QString aName)
|
|
66 |
{
|
|
67 |
iPvtImpl->iName = aName;
|
|
68 |
}
|
|
69 |
|
|
70 |
void CpixDocumentField::setValue(const QString aValue)
|
|
71 |
{
|
|
72 |
iPvtImpl->iValue = aValue;
|
|
73 |
}
|
|
74 |
|
|
75 |
void CpixDocumentField::setConfig(const int aConfig)
|
|
76 |
{
|
|
77 |
iPvtImpl->iConfig = aConfig;
|
|
78 |
}
|
|
79 |
|
24
|
80 |
QStringList CpixDocumentField::values() const
|
|
81 |
{
|
|
82 |
QString str = iPvtImpl->iValue;
|
|
83 |
return str.split(QRegExp(SEPERATOR_EXP));
|
|
84 |
}
|
|
85 |
|
13
|
86 |
//End of File
|