3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/28/2010 Added this text. :-)
17 #include "dialogfactory.h"
21 DialogFactory * DialogFactory::uniqueInstance = NULL;
24 * Private constructor.
26 DialogFactory::DialogFactory()
28 DEBUG->print("DialogFacgory::DialogFactory");
30 DEBUG->print("DialogFacgory::DialogFactory: OK");
33 /*virtual*/ DialogFactory::~DialogFactory()
38 * @return Instance to the unique font list.
40 DialogFactory * DialogFactory::instance()
42 DEBUG->print("DialogFactory::instance()");
44 if (uniqueInstance == NULL)
45 uniqueInstance = new DialogFactory();
47 DEBUG->print("DialogFactory::instance(): OK");
49 return uniqueInstance;
53 * Sets the real factory object that can create and show dialogs.
55 void DialogFactory::setFactoryObject(DialogFactoryInterface * fo)
57 DEBUG->print("DialogFactory::setFactoryObject");
59 DEBUG->print("DialogFactory::setFactoryObject: OK");
63 * @return Factory object. This is never NULL. If no factory
64 * object was set, the default adapter will be returned.
66 DialogFactoryInterface * DialogFactory::getFactoryObject()
68 DEBUG->print("DialogFactory::getFactoryObject");
70 if (factoryObject != NULL)
72 DEBUG->print("DialogFactory::getFactoryObject: returning factory object");
77 DEBUG->print("DialogFactory::getFactoryObject: returning adapter");
78 return &factoryAdapter;
82 void DialogFactory::commandMessage(const QString & m)
84 DEBUG->print("DialogFactory::commandMessage");
86 if (factoryObject != NULL)
87 factoryObject->commandMessage(m);