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

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codegenerators
  • ruby
rubycodegenerationpolicypage.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2005 *
8  * Richard Dale <Richard_Dale@tipitina.demon.co.uk> *
9  * copyright (C) 2006-2013 *
10  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
11  ***************************************************************************/
12 
13 // own header
14 #include "rubycodegenerationpolicypage.h"
15 
16 // app includes
17 #include "codegenerationpolicy.h"
18 #include "uml.h"
19 
20 // kde includes
21 #include <klocale.h>
22 
23 RubyCodeGenerationPolicyPage::RubyCodeGenerationPolicyPage(QWidget *parent, const char *name, RubyCodeGenerationPolicy * policy)
24  : CodeGenerationPolicyPage(parent, name, policy)
25 {
26  CodeGenerationPolicy *common = UMLApp::app()->commonPolicy();
27  form.setupUi(this);
28  form.m_SelectCommentStyle->setCurrentIndex((int)(common->getCommentStyle()));
29  form.m_generateConstructors->setChecked(common->getAutoGenerateConstructors());
30  form.m_generateAttribAccessors->setChecked(policy->getAutoGenerateAttribAccessors());
31  form.m_generateAssocAccessors->setChecked(policy->getAutoGenerateAssocAccessors());
32  form.m_accessorScopeCB->setCurrentIndex(common->getAttributeAccessorScope());
33  form.m_assocFieldScopeCB->setCurrentIndex(common->getAssociationFieldScope());
34 }
35 
36 RubyCodeGenerationPolicyPage::~RubyCodeGenerationPolicyPage()
37 {
38 }
39 
40 void RubyCodeGenerationPolicyPage::apply()
41 {
42  CodeGenerationPolicy *common = UMLApp::app()->commonPolicy();
43 
44  // now do our ruby-specific configs
45  RubyCodeGenerationPolicy * parent = (RubyCodeGenerationPolicy*) m_parentPolicy;
46 
47  // block signals so we don't cause too many update content calls to code documents
48  parent->blockSignals(true);
49 
50  common->setCommentStyle((CodeGenerationPolicy::CommentStyle) form.m_SelectCommentStyle->currentIndex());
51  common->setAttributeAccessorScope(Uml::Visibility::fromInt(form.m_accessorScopeCB->currentIndex()));
52  common->setAssociationFieldScope(Uml::Visibility::fromInt(form.m_assocFieldScopeCB->currentIndex()));
53  common->setAutoGenerateConstructors(form.m_generateConstructors->isChecked());
54  parent->setAutoGenerateAttribAccessors(form.m_generateAttribAccessors->isChecked());
55  parent->setAutoGenerateAssocAccessors(form.m_generateAssocAccessors->isChecked());
56 
57  parent->blockSignals(false);
58 
59  // now send out modified code content signal
60  common->emitModifiedCodeContentSig();
61 }
62 
63 #include "rubycodegenerationpolicypage.moc"
RubyCodeGenerationPolicyPage::form
Ui::RubyCodeGenerationFormBase form
Definition: rubycodegenerationpolicypage.h:31
CodeGenerationPolicyPage::m_parentPolicy
CodeGenPolicyExt * m_parentPolicy
Definition: codegenerationpolicypage.h:41
CodeGenerationPolicy::setAutoGenerateConstructors
void setAutoGenerateConstructors(bool var)
Set the value of m_autoGenerateConstructors.
Definition: codegenerationpolicy.cpp:355
Uml::Visibility::fromInt
Enum fromInt(int item)
Convert a integer item into Visibility representation.
Definition: basictypes.cpp:142
CodeGenerationPolicy::emitModifiedCodeContentSig
void emitModifiedCodeContentSig()
Emits the signal 'ModifiedCodeContent'.
Definition: codegenerationpolicy.cpp:420
QWidget
UMLApp::app
static UMLApp * app()
Get the last created instance of this class.
Definition: uml.cpp:206
CodeGenerationPolicy
class CodeGenerationPolicy This class describes the code generation policy for this project...
Definition: codegenerationpolicy.h:29
CodeGenerationPolicy::setAssociationFieldScope
void setAssociationFieldScope(Uml::Visibility::Enum var)
Set the value of m_associationFieldScope.
Definition: codegenerationpolicy.cpp:393
codegenerationpolicy.h
CodeGenerationPolicy::CommentStyle
CommentStyle
Definition: codegenerationpolicy.h:50
CodeGenerationPolicy::getAssociationFieldScope
Uml::Visibility::Enum getAssociationFieldScope()
Get the value of m_associationFieldScope.
Definition: codegenerationpolicy.cpp:403
RubyCodeGenerationPolicyPage::~RubyCodeGenerationPolicyPage
virtual ~RubyCodeGenerationPolicyPage()
Definition: rubycodegenerationpolicypage.cpp:36
RubyCodeGenerationPolicy
Definition: rubycodegenerationpolicy.h:24
UMLApp::commonPolicy
CodeGenerationPolicy * commonPolicy() const
Returns the default code generation policy.
Definition: uml.cpp:2132
CodeGenerationPolicy::setAttributeAccessorScope
void setAttributeAccessorScope(Uml::Visibility::Enum var)
Set the value of m_attributeAccessorScope.
Definition: codegenerationpolicy.cpp:374
CodeGenerationPolicy::getAutoGenerateConstructors
bool getAutoGenerateConstructors()
Get the value of m_autoGenerateConstructors.
Definition: codegenerationpolicy.cpp:365
CodeGenerationPolicy::setCommentStyle
void setCommentStyle(CommentStyle new_var)
Set the value of m_commentStyle.
Definition: codegenerationpolicy.cpp:89
CodeGenerationPolicy::getAttributeAccessorScope
Uml::Visibility::Enum getAttributeAccessorScope()
Get the value of m_attributeAccessorScope.
Definition: codegenerationpolicy.cpp:384
CodeGenerationPolicyPage
Definition: codegenerationpolicypage.h:30
RubyCodeGenerationPolicy::getAutoGenerateAttribAccessors
bool getAutoGenerateAttribAccessors()
Get the value of m_autoGenerateAttribAccessors.
Definition: rubycodegenerationpolicy.cpp:64
RubyCodeGenerationPolicyPage::RubyCodeGenerationPolicyPage
RubyCodeGenerationPolicyPage(QWidget *parent=0, const char *name=0, RubyCodeGenerationPolicy *policy=0)
Definition: rubycodegenerationpolicypage.cpp:23
RubyCodeGenerationPolicy::getAutoGenerateAssocAccessors
bool getAutoGenerateAssocAccessors()
Get the value of m_autoGenerateAssocAccessors.
Definition: rubycodegenerationpolicy.cpp:73
RubyCodeGenerationPolicyPage::apply
void apply()
Definition: rubycodegenerationpolicypage.cpp:40
RubyCodeGenerationPolicy::setAutoGenerateAttribAccessors
void setAutoGenerateAttribAccessors(bool var)
Set the value of m_autoGenerateAttribAccessors.
Definition: rubycodegenerationpolicy.cpp:44
CodeGenerationPolicy::getCommentStyle
CommentStyle getCommentStyle()
Get the value of m_commentStyle.
Definition: codegenerationpolicy.cpp:99
rubycodegenerationpolicypage.h
RubyCodeGenerationPolicy::setAutoGenerateAssocAccessors
void setAutoGenerateAssocAccessors(bool var)
Set the value of m_autoGenerateAssocAccessors.
Definition: rubycodegenerationpolicy.cpp:54
uml.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • 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