• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • parts
  • kpart
partfactory.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta KPart module, made within the KDE community.
3 
4  Copyright 2003,2007,2009 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #include "partfactory.h"
24 
25 // part
26 #include "part.h"
27 // Okteta Kasten
28 #include <bytearrayviewprofilemanager.h>
29 #include <bytearraystreamencoderconfigeditorfactoryfactory.h>
30 #include <bytearraydatageneratorconfigeditorfactoryfactory.h>
31 #include <bytearraystreamencoderfactory.h>
32 #include <bytearraydatageneratorfactory.h>
33 // KDE
34 #include <KComponentData>
35 #include <KAboutData>
36 #include <KLocale>
37 
38 
39 // Part
40 static const char PartId[] = "oktetapart";
41 static const char PartName[] = I18N_NOOP("OktetaPart");
42 static const char PartDescription[] = I18N_NOOP("Embedded hex editor");
43 static const char PartVersion[] = "0.5.0";
44 static const char PartCopyright[] = "2003-2009 Friedrich W. H. Kossebau";
45 // Author
46 static const char FWHKName[] = "Friedrich W. H. Kossebau";
47 static const char FWHKTask[] = I18N_NOOP("Author");
48 static const char FWHKEmailAddress[] = "kossebau@kde.org";
49 
50 
51 OktetaPartFactory::OktetaPartFactory()
52 {
53 // TODO: also load encoder and other plugins here
54  mAboutData = new KAboutData( PartId, 0, ki18n(PartName), PartVersion, ki18n(PartDescription),
55  KAboutData::License_GPL_V2, ki18n(PartCopyright), KLocalizedString(), 0, FWHKEmailAddress );
56  mAboutData->addAuthor( ki18n(FWHKName), ki18n(FWHKTask), FWHKEmailAddress );
57  mComponentData = new KComponentData( mAboutData );
58 
59  mByteArrayViewProfileManager = new Kasten2::ByteArrayViewProfileManager();
60 
61 // const QList<AbstractModelStreamEncoder*> encoderList =
62 // ByteArrayStreamEncoderFactory::createStreamEncoders();
63 
64 // const QList<AbstractModelDataGenerator*> generatorList =
65 // ByteArrayDataGeneratorFactory::createDataGenerators();
66 
67 // const QList<AbstractModelStreamEncoderConfigEditorFactory*> encoderConfigEditorFactoryList =
68 // ByteArrayStreamEncoderConfigEditorFactoryFactory::createFactorys();
69 
70 // const QList<AbstractModelDataGeneratorConfigEditorFactory*> generatorConfigEditorFactoryList =
71 // ByteArrayDataGeneratorConfigEditorFactoryFactory::createFactorys();
72 
73 // mDocumentManager->codecManager()->setEncoders( encoderList );
74 // mDocumentManager->codecManager()->setGenerators( generatorList );
75 // mDocumentManager->syncManager()->setDocumentSynchronizerFactory( new ByteArrayRawFileSynchronizerFactory() );
76 
77 // mViewManager->codecViewManager()->setEncoderConfigEditorFactories( encoderConfigEditorFactoryList );
78 // mViewManager->codecViewManager()->setGeneratorConfigEditorFactories( generatorConfigEditorFactoryList );
79 }
80 
81 
82 KParts::Part* OktetaPartFactory::createPartObject( QWidget* parentWidget,
83  QObject* parent,
84  const char* cn, const QStringList& args )
85 {
86 Q_UNUSED( parentWidget )
87 Q_UNUSED( args )
88 
89  const QByteArray className( cn );
90  const OktetaPart::Modus modus =
91  ( className == "KParts::ReadOnlyPart" ) ? OktetaPart::ReadOnlyModus :
92  ( className == "Browser/View" ) ? OktetaPart::BrowserViewModus :
93  /* else */ OktetaPart::ReadWriteModus;
94 
95  OktetaPart* part = new OktetaPart( parent, *mComponentData, modus, mByteArrayViewProfileManager );
96 
97  return part;
98 }
99 
100 
101 OktetaPartFactory::~OktetaPartFactory()
102 {
103  delete mComponentData;
104  delete mAboutData;
105  delete mByteArrayViewProfileManager;
106 }
PartId
static const char PartId[]
Definition: partfactory.cpp:40
OktetaPartFactory::createPartObject
virtual KParts::Part * createPartObject(QWidget *parentWidget, QObject *parent, const char *className, const QStringList &args)
Definition: partfactory.cpp:82
PartDescription
static const char PartDescription[]
Definition: partfactory.cpp:42
PartVersion
static const char PartVersion[]
Definition: partfactory.cpp:43
bytearraydatageneratorfactory.h
QWidget
OktetaPartFactory::OktetaPartFactory
OktetaPartFactory()
Definition: partfactory.cpp:51
PartName
static const char PartName[]
Definition: partfactory.cpp:41
bytearrayviewprofilemanager.h
FWHKEmailAddress
static const char FWHKEmailAddress[]
Definition: partfactory.cpp:48
QObject
FWHKTask
static const char FWHKTask[]
Definition: partfactory.cpp:47
bytearraystreamencoderconfigeditorfactoryfactory.h
FWHKName
static const char FWHKName[]
Definition: partfactory.cpp:46
KAboutData
partfactory.h
OktetaPart::BrowserViewModus
Definition: part.h:50
OktetaPart::ReadOnlyModus
Definition: part.h:50
bytearraystreamencoderfactory.h
OktetaPart::ReadWriteModus
Definition: part.h:50
PartCopyright
static const char PartCopyright[]
Definition: partfactory.cpp:44
Kasten2::ByteArrayViewProfileManager
Definition: bytearrayviewprofilemanager.h:65
OktetaPartFactory::~OktetaPartFactory
virtual ~OktetaPartFactory()
Definition: partfactory.cpp:101
bytearraydatageneratorconfigeditorfactoryfactory.h
OktetaPart::Modus
Modus
Definition: part.h:50
OktetaPart
Definition: part.h:43
part.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal