1 /*
2  * PROJECT:     PAINT for ReactOS
3  * LICENSE:     LGPL
4  * FILE:        base/applications/mspaint/palettemodel.h
5  * PURPOSE:     Keep track of palette data, notify listeners
6  * PROGRAMMERS: Benedikt Freisen
7  */
8 
9 #pragma once
10 
11 #define NUM_COLORS 28
12 
13 enum PAL_TYPE
14 {
15     PAL_MODERN = 1,
16     PAL_OLDTYPE = 2,
17 };
18 
19 /* CLASSES **********************************************************/
20 
21 class PaletteModel
22 {
23 private:
24     COLORREF m_colors[NUM_COLORS];
25     PAL_TYPE m_nSelectedPalette;
26     COLORREF m_fgColor;
27     COLORREF m_bgColor;
28 
29     void NotifyColorChanged();
30     void NotifyPaletteChanged();
31 
32 public:
33     PaletteModel();
34     PAL_TYPE SelectedPalette();
35     void SelectPalette(PAL_TYPE nPalette);
36     COLORREF GetColor(UINT nIndex) const;
37     void SetColor(UINT nIndex, COLORREF newColor);
38     COLORREF GetFgColor() const;
39     void SetFgColor(COLORREF newColor);
40     COLORREF GetBgColor() const;
41     void SetBgColor(COLORREF newColor);
42 };
43