You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.8 KiB
92 lines
2.8 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||
11 years ago
|
Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.org>
|
||
15 years ago
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
15 years ago
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
15 years ago
|
*/
|
||
|
|
||
|
/**
|
||
11 years ago
|
@file tdevcompileroptions.h
|
||
15 years ago
|
The interface to compiler options configuration.
|
||
|
*/
|
||
|
|
||
11 years ago
|
#ifndef _TDEVCOMPILEROPTIONS_H_
|
||
|
#define _TDEVCOMPILEROPTIONS_H_
|
||
15 years ago
|
|
||
15 years ago
|
#include <tqobject.h>
|
||
15 years ago
|
|
||
|
/**
|
||
|
The interface to compiler options configuration.
|
||
|
Used by build systems to give users a compiler options configuration dialog.
|
||
|
|
||
|
Common use case:
|
||
|
@code
|
||
11 years ago
|
static TDevCompilerOptions *createCompilerOptions( const TQString &name, TQObject *parent )
|
||
15 years ago
|
{
|
||
|
KService::Ptr service = KService::serviceByDesktopName( name );
|
||
|
if ( !service )
|
||
|
return 0;
|
||
|
|
||
15 years ago
|
KLibFactory *factory = KLibLoader::self()->factory(TQFile::encodeName(service->library()));
|
||
15 years ago
|
if (!factory)
|
||
|
return 0;
|
||
|
|
||
15 years ago
|
TQStringList args;
|
||
13 years ago
|
TQVariant prop = service->property("X-TDevelop-Args");
|
||
15 years ago
|
if (prop.isValid())
|
||
15 years ago
|
args = TQStringList::split(" ", prop.toString());
|
||
15 years ago
|
|
||
14 years ago
|
TQObject *obj = factory->create(parent, service->name().latin1(),
|
||
11 years ago
|
"TDevCompilerOptions", args);
|
||
15 years ago
|
|
||
11 years ago
|
if (!obj->inherits("TDevCompilerOptions"))
|
||
15 years ago
|
return 0;
|
||
|
|
||
11 years ago
|
TDevCompilerOptions *dlg = (TDevCompilerOptions*) obj;
|
||
15 years ago
|
return dlg;
|
||
|
}
|
||
|
|
||
|
...
|
||
11 years ago
|
TDevCompilerOptions *plugin = createCompilerOptions(compilerName, parent);
|
||
15 years ago
|
TQString flags = ""; //old compiler flags
|
||
15 years ago
|
if ( plugin )
|
||
|
{
|
||
14 years ago
|
flags = plugin->exec( parent, flags ); //new compiler flags are returned
|
||
15 years ago
|
delete plugin;
|
||
|
}
|
||
|
@endcode
|
||
|
*/
|
||
11 years ago
|
class TDevCompilerOptions : public TQObject
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
|
||
|
public:
|
||
11 years ago
|
TDevCompilerOptions( TQObject *parent=0, const char *name=0 );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Opens a dialog which allows the user to configure the
|
||
|
* compiler options. The initial settings in the dialog
|
||
|
* will be set from the flags argument of this method.
|
||
|
* After the dialog is accepted, the new settings will
|
||
|
* be returned as a string. If the dialog was cancelled,
|
||
14 years ago
|
* TQString() is returned.
|
||
15 years ago
|
*/
|
||
14 years ago
|
virtual TQString exec(TQWidget *parent, const TQString &flags) = 0;
|
||
15 years ago
|
};
|
||
|
|
||
|
#endif
|