Move it to its own file.
In the constructor, you should pass the session.
I tried to give you the hints to help you find how to do that though, here's the partial implementation of HTMLRendereIMAPDataCallback:
I hope it will help finish the implementation of this feature.

```
HTMLRendererIMAPDataCallback::HTMLRendererIMAPDataCallback(IMAPSession * session, uint32_t uid)
{
  mSession = session;
  mUid = uid;
  mError = ErrorNone;
}

Data * HTMLRendererIMAPDataCallback::dataForIMAPPart(String * folder, IMAPPart * part)
{
        return fetchMessageAttachmentByUID(folder, uid, part->partID(), part->encoding(), NULL, &mError);
}

HTMLRendererIMAPDataCallback::error()
{
  return mError;
}

```