1 /* BurrTools
2  *
3  * BurrTools is the legal property of its developers, whose
4  * names are listed in the COPYRIGHT file, which is included
5  * within the source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20  */
21 #ifndef __ASSMIMPORT_WINDOW_H__
22 #define __ASSMIMPORT_WINDOW_H__
23 
24 #include "Layouter.h"
25 
26 class puzzle_c;
27 class ProblemSelector;
28 class Fl_Round_Button;
29 class Fl_Check_Button;
30 class Fl_Int_Input;
31 
32 /* The window that asks the user to which new gridtype the current puzzle should
33  * be converted. The list is dynamically created depending on the
34  * canConvert function returns
35  *
36  * okSelected returns true, when the user pressed the continue button, false in all other cases
37  * the selected grid can be aquired with getTargetType
38  */
39 class assmImportWindow_c : public LFl_Double_Window {
40 
41   private:
42 
43     bool _ok;
44 
45     ProblemSelector *problemSelectorSrc, *problemSelectorDst;
46     Fl_Round_Button *rdDontAdd, *rdAddNew, *rdAddDst;
47     Fl_Check_Button *ckDrpDisconnected, *ckDrpMirror, *ckDrpSymm, *ckDrpMillable, *ckDrpNotchable, *ckDrpIdentical;
48     Fl_Int_Input *min, *max, *shapeMin, *shapeMax;
49 
50   public:
51 
52     assmImportWindow_c(const puzzle_c * puzzle);
53 
okSelected(void)54     bool okSelected(void) { return _ok; }
55 
56     void okay_cb(void);
57 
58     int getSrcProblem(void);
59     int getDstProblem(void);
60 
61     enum
62     {
63       A_DONT_ADD,
64       A_ADD_NEW,
65       A_ADD_DST
66     } ;
67 
68     int getAction(void);
69 
70     static const int dropDisconnected = 0x01;
71     static const int dropMirror       = 0x02;
72     static const int dropSymmetric    = 0x04;
73     static const int dropNonMillable  = 0x08;
74     static const int dropNonNotchable = 0x10;
75     static const int dropIdentical    = 0x20;
76 
77     unsigned int getFilter(void);
78 
79     unsigned int getMin(void);
80     unsigned int getMax(void);
81 
82     unsigned int getShapeMin(void);
83     unsigned int getShapeMax(void);
84 };
85 
86 #endif
87