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 // 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 "rs_dialogfactory.h"
21 RS_DialogFactory * RS_DialogFactory::uniqueInstance = NULL;
24 * Private constructor.
26 RS_DialogFactory::RS_DialogFactory()
28 RS_DEBUG->print("RS_DialogFacgory::RS_DialogFactory");
30 RS_DEBUG->print("RS_DialogFacgory::RS_DialogFactory: OK");
33 /*virtual*/ RS_DialogFactory::~RS_DialogFactory()
38 * @return Instance to the unique font list.
40 RS_DialogFactory * RS_DialogFactory::instance()
42 RS_DEBUG->print("RS_DialogFactory::instance()");
44 if (uniqueInstance == NULL)
45 uniqueInstance = new RS_DialogFactory();
47 RS_DEBUG->print("RS_DialogFactory::instance(): OK");
49 return uniqueInstance;
53 * Sets the real factory object that can create and show dialogs.
55 void RS_DialogFactory::setFactoryObject(RS_DialogFactoryInterface * fo)
57 RS_DEBUG->print("RS_DialogFactory::setFactoryObject");
59 RS_DEBUG->print("RS_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 RS_DialogFactoryInterface * RS_DialogFactory::getFactoryObject()
68 RS_DEBUG->print("RS_DialogFactory::getFactoryObject");
70 if (factoryObject != NULL)
72 RS_DEBUG->print("RS_DialogFactory::getFactoryObject: returning factory object");
77 RS_DEBUG->print("RS_DialogFactory::getFactoryObject: returning adapter");
78 return &factoryAdapter;
82 void RS_DialogFactory::commandMessage(const QString & m)
84 RS_DEBUG->print("RS_DialogFactory::commandMessage");
86 if (factoryObject != NULL)
87 factoryObject->commandMessage(m);