1 /* 2 * Copyright (C) 2002 - David W. Durham 3 * 4 * This file is part of ReZound, an audio editing application. 5 * 6 * ReZound is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published 8 * by the Free Software Foundation; either version 2 of the License, 9 * or (at your option) any later version. 10 * 11 * ReZound is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 */ 20 21 #ifndef __AActionDialog_H__ 22 #define __AActionDialog_H__ 23 24 #include "../../config/common.h" 25 26 class AActionDialog; 27 28 #include <stddef.h> 29 #include <string> 30 31 class CActionParameters; 32 class CActionSound; 33 34 /* 35 * Any dialog shown to the user for an action to be performed should derived from 36 * this class so that the backend can show the dialog independant of the frontend 37 * implementation. 38 * 39 * The show method should return true if the action is to be performed or false if 40 * the users press say a cancel button, it should also fill actionParameters with 41 * the values for the action to use. The order and type of those parameters should 42 * be agreed upon by the action implementation and the dialog implementation. 43 */ 44 class AActionDialog 45 { 46 public: 47 AActionDialog(); 48 virtual ~AActionDialog(); 49 50 virtual bool show(CActionSound *actionSound,CActionParameters *actionParameters)=0; 51 virtual void hide()=0; 52 53 // for the action dialog of an AActionFactory (i.e. not the channelSelectDialog) 54 // this gets called just before each call to show(), given the action factory's name 55 virtual void setTitle(const string title)=0; 56 57 // can be implemented to get data from the dialog which does not fit the normal model of passing parameters to actions 58 // namely, right now, the matrix of bools that indicates how to paste data is obtained through this method 59 // I wouldn't need to necessarily use this method if actionParameters had perhaps a 2dim bool array type or something getUserData()60 virtual void *getUserData() { return(NULL); } 61 62 // performAction sets this to true if a dialog was shown else false 63 bool wasShown; 64 }; 65 66 #endif 67