|
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 <qcpixdocument.h> |
|
19 #include <qcpixdocumentfield.h> |
|
20 #include "qcpixdocumentprivate.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 QCPixDocument::QCPixDocument() |
|
28 :iPvtImpl( new QCPixDocumentPrivate() ) |
|
29 { |
|
30 } |
|
31 |
|
32 QCPixDocument* QCPixDocument::newInstance() |
|
33 { |
|
34 QCPixDocument* doc = NULL; |
|
35 try{ |
|
36 doc = new QCPixDocument(); |
|
37 } |
|
38 catch(...){ |
|
39 delete doc; |
|
40 return NULL; |
|
41 } |
|
42 return doc; |
|
43 } |
|
44 |
|
45 QCPixDocument::~QCPixDocument() |
|
46 { |
|
47 delete iPvtImpl; |
|
48 } |
|
49 |
|
50 QString QCPixDocument::docId() const |
|
51 { |
|
52 return iPvtImpl->iDocId; |
|
53 } |
|
54 |
|
55 QString QCPixDocument::excerpt() const |
|
56 { |
|
57 return iPvtImpl->iExcerpt; |
|
58 } |
|
59 |
|
60 QString QCPixDocument::baseAppClass() const |
|
61 { |
|
62 return iPvtImpl->iBaseAppClass; |
|
63 } |
|
64 |
|
65 const QCPixDocumentField& QCPixDocument::field( const int aIndex ) const |
|
66 { |
|
67 return *(iPvtImpl->iFields.at(aIndex)); |
|
68 } |
|
69 |
|
70 int QCPixDocument::fieldCount() const |
|
71 { |
|
72 return iPvtImpl->iFields.count(); |
|
73 } |
|
74 |
|
75 void QCPixDocument::setDocId(const QString aDocId) |
|
76 { |
|
77 iPvtImpl->iDocId = aDocId; |
|
78 } |
|
79 |
|
80 void QCPixDocument::setExcerpt(const QString aExcerpt) |
|
81 { |
|
82 iPvtImpl->iExcerpt = aExcerpt; |
|
83 } |
|
84 |
|
85 void QCPixDocument::setBaseAppClass(const QString aBaseAppClass) |
|
86 { |
|
87 iPvtImpl->iBaseAppClass = aBaseAppClass; |
|
88 } |
|
89 |
|
90 void QCPixDocument::addField(const QString aName, const QString aValue, const int aConfig) |
|
91 { |
|
92 iPvtImpl->iFields.append( QCPixDocumentField::newInstance( aName, aValue, aConfig ) ); |
|
93 } |
|
94 |
|
95 //End of File |