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 |
*/
|
|
17 |
|
|
18 |
#include <cpixdocument.h>
|
|
19 |
#include <cpixdocumentfield.h>
|
|
20 |
#include "cpixdocumentprivate.h"
|
|
21 |
|
|
22 |
/**
|
|
23 |
* Note: Code in this file should never throw OR leak symbian exceptions.
|
|
24 |
* Convert all leaves to C++ exceptions.
|
|
25 |
*/
|
|
26 |
|
|
27 |
CpixDocument::CpixDocument()
|
|
28 |
:iPvtImpl( new CpixDocumentPrivate() )
|
|
29 |
{
|
|
30 |
}
|
|
31 |
|
|
32 |
CpixDocument* CpixDocument::newInstance()
|
|
33 |
{
|
|
34 |
CpixDocument* doc = NULL;
|
|
35 |
try{
|
|
36 |
doc = new CpixDocument();
|
|
37 |
}
|
|
38 |
catch(...){
|
|
39 |
delete doc;
|
|
40 |
return NULL;
|
|
41 |
}
|
|
42 |
return doc;
|
|
43 |
}
|
|
44 |
|
|
45 |
CpixDocument::~CpixDocument()
|
|
46 |
{
|
|
47 |
delete iPvtImpl;
|
|
48 |
}
|
|
49 |
|
|
50 |
QString CpixDocument::docId() const
|
|
51 |
{
|
|
52 |
return iPvtImpl->iDocId;
|
|
53 |
}
|
|
54 |
|
|
55 |
QString CpixDocument::excerpt() const
|
|
56 |
{
|
|
57 |
return iPvtImpl->iExcerpt;
|
|
58 |
}
|
|
59 |
|
|
60 |
QString CpixDocument::baseAppClass() const
|
|
61 |
{
|
|
62 |
return iPvtImpl->iBaseAppClass;
|
|
63 |
}
|
|
64 |
|
|
65 |
const CpixDocumentField& CpixDocument::field( const int aIndex ) const
|
|
66 |
{
|
|
67 |
return *(iPvtImpl->iFields.at(aIndex));
|
|
68 |
}
|
|
69 |
|
|
70 |
int CpixDocument::fieldCount() const
|
|
71 |
{
|
|
72 |
return iPvtImpl->iFields.count();
|
|
73 |
}
|
|
74 |
|
|
75 |
void CpixDocument::setDocId(const QString aDocId)
|
|
76 |
{
|
|
77 |
iPvtImpl->iDocId = aDocId;
|
|
78 |
}
|
|
79 |
|
|
80 |
void CpixDocument::setExcerpt(const QString aExcerpt)
|
|
81 |
{
|
|
82 |
iPvtImpl->iExcerpt = aExcerpt;
|
|
83 |
}
|
|
84 |
|
|
85 |
void CpixDocument::setBaseAppClass(const QString aBaseAppClass)
|
|
86 |
{
|
|
87 |
iPvtImpl->iBaseAppClass = aBaseAppClass;
|
|
88 |
}
|
|
89 |
|
|
90 |
void CpixDocument::addField(const QString aName, const QString aValue, const int aConfig)
|
|
91 |
{
|
|
92 |
iPvtImpl->iFields.append( CpixDocumentField::newInstance( aName, aValue, aConfig ) );
|
|
93 |
}
|
|
94 |
|
|
95 |
//End of File
|