1 // rs_dialogfactory.cpp
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 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/28/2010 Added this text. :-)
15 #include "rs_dialogfactory.h"
19 RS_DialogFactory * RS_DialogFactory::uniqueInstance = NULL;
22 * Private constructor.
24 RS_DialogFactory::RS_DialogFactory()
26 RS_DEBUG->print("RS_DialogFacgory::RS_DialogFactory");
28 RS_DEBUG->print("RS_DialogFacgory::RS_DialogFactory: OK");
32 * @return Instance to the unique font list.
34 RS_DialogFactory * RS_DialogFactory::instance()
36 RS_DEBUG->print("RS_DialogFactory::instance()");
38 if (uniqueInstance == NULL)
39 uniqueInstance = new RS_DialogFactory();
41 RS_DEBUG->print("RS_DialogFactory::instance(): OK");
43 return uniqueInstance;
47 * Sets the real factory object that can create and show dialogs.
49 void RS_DialogFactory::setFactoryObject(RS_DialogFactoryInterface * fo)
51 RS_DEBUG->print("RS_DialogFactory::setFactoryObject");
53 RS_DEBUG->print("RS_DialogFactory::setFactoryObject: OK");
57 * @return Factory object. This is never NULL. If no factory
58 * object was set, the default adapter will be returned.
60 RS_DialogFactoryInterface * RS_DialogFactory::getFactoryObject()
62 RS_DEBUG->print("RS_DialogFactory::getFactoryObject");
64 if (factoryObject != NULL)
66 RS_DEBUG->print("RS_DialogFactory::getFactoryObject: returning factory object");
71 RS_DEBUG->print("RS_DialogFactory::getFactoryObject: returning adapter");
72 return &factoryAdapter;
76 void RS_DialogFactory::commandMessage(const QString & m)
78 RS_DEBUG->print("RS_DialogFactory::commandMessage");
80 if (factoryObject != NULL)
81 factoryObject->commandMessage(m);