source: trunk/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.cpp

Last change on this file was 197, checked in by rudi, 14 years ago

Added QtDesigner

File size: 2.8 KB
Line 
1/**********************************************************************
2**
3** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved.
4**
5** This file is part of Qt Designer.
6**
7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file.
11**
12** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
13** licenses may use this file in accordance with the Qt Commercial License
14** Agreement provided with the Software.
15**
16** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18**
19** See http://www.trolltech.com/gpl/ for GPL licensing information.
20** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
21** information about Qt Commercial License Agreements.
22**
23** Contact info@trolltech.com if any conditions of this licensing are
24** not clear to you.
25**
26**********************************************************************/
27
28#include "projectsettingsinterfaceimpl.h"
29#include "projectsettings.h"
30
31ProjectSettingsInterfaceImpl::ProjectSettingsInterfaceImpl( QUnknownInterface *outer )
32 : parent( outer ),
33 ref( 0 ),
34 settingsTab( 0 )
35{
36}
37
38ulong ProjectSettingsInterfaceImpl::addRef()
39{
40 return parent ? parent->addRef() : ref++;
41}
42
43ulong ProjectSettingsInterfaceImpl::release()
44{
45 if ( parent )
46 return parent->release();
47 if ( !--ref ) {
48 delete this;
49 return 0;
50 }
51 return ref;
52}
53
54ProjectSettingsInterface::ProjectSettings *ProjectSettingsInterfaceImpl::projectSetting()
55{
56 if ( !settingsTab ) {
57 settingsTab = new CppProjectSettings( 0 );
58 settingsTab->hide();
59 }
60 ProjectSettings *pf = 0;
61 pf = new ProjectSettings;
62 pf->tab = settingsTab;
63 pf->title = "C++";
64 pf->receiver = pf->tab;
65 pf->init_slot = SLOT( reInit( QUnknownInterface * ) );
66 pf->accept_slot = SLOT( save( QUnknownInterface * ) );
67 return pf;
68}
69
70QStringList ProjectSettingsInterfaceImpl::projectSettings() const
71{
72 return QStringList();
73}
74
75void ProjectSettingsInterfaceImpl::connectTo( QUnknownInterface * )
76{
77}
78
79void ProjectSettingsInterfaceImpl::deleteProjectSettingsObject( ProjectSettings *pf )
80{
81 delete pf;
82}
83
84QRESULT ProjectSettingsInterfaceImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
85{
86 if ( parent )
87 return parent->queryInterface( uuid, iface );
88
89 *iface = 0;
90 if ( uuid == IID_QUnknown )
91 *iface = (QUnknownInterface*)this;
92 else if ( uuid == IID_ProjectSettings )
93 *iface = (ProjectSettingsInterface*)this;
94 else
95 return QE_NOINTERFACE;
96
97 (*iface)->addRef();
98 return QS_OK;
99}
Note: See TracBrowser for help on using the repository browser.