void odp_conversion_context::end_note()
{
	slide_context_.end_page();

	slide_context_.remove_page();

	current_slide().drawing_context()->end_element();
	current_slide().drawing_context()->end_drawing();
}
void odp_conversion_context::start_comment_content()
{
	current_slide().comment_context()->start_comment_content();
	
	office_element_ptr & root_comm_element = current_slide().drawing_context()->get_current_element();
	start_text_context();

	text_context()->start_element(root_comm_element);
	text_context()->start_paragraph();
}
void odp_conversion_context::start_comment(int oox_comm_id)
{
	office_element_ptr comm_elm;
	create_element(L"office", L"annotation", comm_elm, this);

	current_slide().comment_context()->start_comment(comm_elm, oox_comm_id);
	
	current_slide().drawing_context()->start_drawing();
	current_slide().drawing_context()->start_element(comm_elm);
}
void SlideshowController::build_slide_queue()
{
  bool slides_were_added = false;

  refresh_directory_list();
  for (int i = 0;
       i < slideshow_data_model_->slide_dir_list()->size();
       ++i)
    {
      SlideDirectory current_dir = slideshow_data_model_->slide_dir_list()->value(i);
      QDirIterator subdir_iterator(current_dir.full_path(),
              QDir::Files | QDir::NoSymLinks | QDir::Hidden,
              QDirIterator::Subdirectories);
      //qWarning() << subdir_iterator.hasNext();
      while (subdir_iterator.hasNext())
        {
          subdir_iterator.next();
          Slide current_slide(subdir_iterator.filePath());
          if(current_dir.is_excluded())
            {
        //      qWarning () << "excluded";
              slideshow_data_model_->slideshow_queue()->
                  remove_key(current_slide.full_path());
            }
          else if (current_slide.slide_type() == INVALID_SLIDE)
            {
              // Do Nothing
              qWarning () << "INVALID SLIDE";
            }
          else if(current_dir.is_marketing_folder())
            {
      //        qWarning() << "marketing";
              if(slideshow_data_model_->slideshow_queue()->
                  add_marketing_slide(current_slide))
                {
                  slides_were_added = true;
                }
            }
          else
            {
        //      qWarning () << "slide";
              if (slideshow_data_model_->slideshow_queue()->
                  add_slide(current_slide))
                {
                  slides_were_added = true;
                }

            }
         // qWarning() <<"[i]: "<< subdir_iterator.filePath();
        }
    }

  // If slides were added to the queue, sort the lists
  if (slides_were_added)
    {
      slideshow_data_model_->slideshow_queue()->sort_all_lists();
    }
  qWarning() << slideshow_data_model_->slideshow_queue()->size();
}
void odp_conversion_context::end_comment_content()
{
	text_context()->end_paragraph();

	current_slide().comment_context()->end_comment_content();

	text_context()->end_element();
	end_text_context();
}
void odp_conversion_context::start_note(bool bMaster)
{
	office_element_ptr note_elm;
	create_element(L"presentation", L"notes", note_elm, this);
	
	current_slide().drawing_context()->start_drawing();
	current_slide().drawing_context()->start_element(note_elm);
	
	slide_context_.start_page(note_elm);	

	if (bMaster)
	{
		page_layout_context()->create_layout_page();

		odf_writer::presentation_notes* notes = dynamic_cast<odf_writer::presentation_notes*>(note_elm.get());
		notes->attlist_.style_page_layout_name_ = page_layout_context()->last_layout()->get_name();
	
		drawing_context()->set_presentation(2);	
	}
	else
		drawing_context()->set_presentation(0);	
}
void odp_conversion_context::end_comment()
{
	current_slide().drawing_context()->end_element();
	current_slide().drawing_context()->end_drawing();
}
void odp_conversion_context::end_drawings()
{
	current_slide().drawing_context()->clear();
}