/* * Alabastra Project - C++ Editor writed with QT Library V.4 * Copyright (C) Igor Maculan - geocronos@gmail.com Marco Buoncristiano - marco.buoncristiano@gmail.com * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "AlMethod.h" void AlMethod::common(){ name=""; returnName=""; className=""; objName=""; }; AlMethod::AlMethod(){ common(); }; AlMethod::AlMethod(QString a_name){ common(); setName(a_name); }; bool AlMethod::setName(QString a_name){ if (a_name.isEmpty()) return false; else{ name=a_name; return true; } }; bool AlMethod::setReturnName(QString a_returnname){ if (a_returnname.isEmpty()) return false; else{ returnName=a_returnname; return true; } }; bool AlMethod::setClassName(QString a_className){ if (a_className.isEmpty()) return false; else{ className=a_className; return true; } }; bool AlMethod::setObjName(QString a_objName){ if (a_objName.isEmpty()) return false; else{ objName=a_objName; return true; } }; QString AlMethod::getName(){ return name; }; QString AlMethod::getReturnName(){ return returnName; }; QString AlMethod::getClassName(){ return className; }; QString AlMethod::getObjName(){ return objName; }; /* * Genera l'implementazione del metodo */ QString AlMethod::getImplementation(){ QString str; if (returnName.isEmpty()) str=QString("%1::%3{\n\t\n};").arg(className).arg(name); else str=QString("%1 %2::%3{\n\t\n};").arg(returnName).arg(className).arg(name); return str; }; /******************************************************************************** *--------------------------------------CLASS AlActionMethod----------------------------------------------* ********************************************************************************/ AlActionMethod::AlActionMethod(QObject *parent) : QAction(parent){ method=NULL; }; bool AlActionMethod::setAlMethod(AlMethod *a_method ){ if (a_method!=NULL){ method=a_method; return true; } else return false; }; AlMethod* AlActionMethod::getAlMethod(){ return method; };