/*****************************************************************************
Open Source MIT License

Copyright (c) 2017 Matthew Ahmed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*****************************************************************************/

#pragma once

#include "Headers.h"

#define SEL_TYPE_INVALID  0
#define SEL_TYPE_ALL      1
#define SEL_TYPE_LISTS    2   // Genre(s) and/or playlist(s)

class CSongsSelection
{
public:
  // Pointer args EXCEPT naRepCounts6 allocated (new) by caller; this class deletes.
  CSongsSelection(INT nType, INT * naRepCounts6, INT nMaxAge, BOOL bDedup,
                  LPTSTR sSelectionName, // LPTSTR sSelectionDisplay,
                  INT * nArr_LbSelectedIndexes = NULL, INT nLbSelectedArraySize = 0,
                  INT * nArr_PlistIndexes = NULL, LPTSTR * spArr_PlistNames = NULL,
                  INT nPlistArraySize = 0,
                  LPTSTR * spArr_GenreNames = NULL, INT nGenreArraySize = 0);
  ~CSongsSelection(void);

  BOOL IsDedup(void);
  BOOL IsAllSongs(void);
  const INT * GetRepCounts();
  BOOL IsExclude(void);
  INT GetMaxAge(void);
  INT GetType(void);
  LPCTSTR GetSelectionName();
  INT GetSelectionNameLen();

//  LPCTSTR GetSelectionDisplay();
  LPCTSTR GetSelectionDisplay(INT nMaxLen);

//  INT GetSelectionDisplayLen();
  const INT * GetLbSelectedIndexesArray();
  INT GetLbSelectedIndexesCount();
  LPCTSTR * GetGenreNamesArray();
  INT GetGenreNamesCount();
  const INT * GetPlistIndexesArray();
  INT GetPlistIndexesCount();




protected:
  INT m_nType;
  INT m_naRepCounts[6];
  INT m_nMaxAge; // 0 for no max age
  BOOL m_bDedup;
  LPTSTR m_sSelectionName;
//  LPTSTR m_sSelectionDisplay; // For tooltip // Replace below
  INT * m_nArr_LbSelectedIndexes;
  INT m_nLbSelectedArraySize;
  INT * m_nArr_PlistIndexes;
  INT m_nPlistArraySize;
  LPTSTR * m_spArr_GenreNames; 
  INT m_nGenreArraySize;
  LPTSTR * m_spArr_PlistNames;

  // Tooltip generated by this class
  LPTSTR m_sTooltipDefault;
  INT m_nLenTooltipDefault;
  LPTSTR m_sTooltipDynamic;

  // For generating tooltip
  INT m_nLenSelectionName;
  LPCTSTR m_sHdrGenres;
  LPCTSTR m_sHdrPlists;
  INT m_nLenHdrGenres;
  INT m_nLenHdrPlists;
  LPCTSTR m_sFmtTruncGenres;
  LPCTSTR m_sFmtTruncPlists;
  INT m_nLenTruncGenres;
  INT m_nLenTruncPlists;
  LPTSTR GetTooltipStr(INT nMaxLen);
};
